(navigation image)
Home American Libraries | Canadian Libraries | Universal Library | Community Texts | Project Gutenberg | Biodiversity Heritage Library | Children's Library | Advanced Microdevices Manuals | Linear Circuits Manuals | Supertex Manuals | Sundry Manuals | Echelon Manuals | RCA Manuals | National Semiconductor Manuals | Hewlett Packard Manuals | Signetics Manuals | Fluke Manuals | Datel Manuals | Intersil Manuals | Zilog Manuals | Maxim Manuals | Dallas Semiconductor Manuals | Temperature Manuals | SGS Manuals | Quantum Electronics Manuals | STDBus Manuals | Texas Instruments Manuals | IBM Microsoft Manuals | Grammar Analysis | Harris Manuals | Arrow Manuals | Monolithic Memories Manuals | Intel Manuals | Fault Tolerance Manuals | Johns Hopkins University Commencement | PHOIBLE Online | International Rectifier Manuals | Rectifiers scrs Triacs Manuals | Standard Microsystems Manuals | Additional Collections | Control PID Fuzzy Logic Manuals | Densitron Manuals | Philips Manuals | The Andhra Pradesh Legislative Assembly Debates | Linear Technologies Manuals | Cermetek Manuals | Miscellaneous Manuals | Hitachi Manuals | The Video Box | Communication Manuals | Scenix Manuals | Motorola Manuals | Agilent Manuals
Search: Advanced Search
Anonymous User (login or join us)
Upload
See other formats

Full text of "Apple II Reference Manual (1979)(Apple)"

» - 




APPLE ][ 

REFERENCE MANUAL 




nppkz computer hx: 



NOTICE 

Apple Computer Inc. reserves the right lo make improvemenis m the product described in ihis 
manual at anj lime and wnhoui notice 



si 



THa m.nu.i a towrnhicd and onimns prapneiar) tnfonwiriiii Ml rtghia m reserved THis dorumem 

whole or pan, be copied, phoiocopied, reproduced, iraiuloied, ra reduced to mj etecirunn medium ..r machine rentable 

intm without I""" canseni, In wniinjb t'"" 1 ftPfrte Computet liu 

IT'l >-,-. Vppti- ( umpitltr Inc. 
Landle) Dnvc 
< uperilno. < -\ 95014 
1408) 996-1010 

\pnic ptDducI numbei V2L0001A (OSIMXHM-OI J 
Wrliien tn Christopnci 



"Apple" is j UTHtemurt '»' Apple Compuiei tni 



£ 






Apple II Reference Manual 




A REFERENCE MANUAL 

FOR THE APPLE II 
AND THE APPLE II PLUS 
PERSONAL COMPUTERS 



I 



E 




► •» 



^ TABLE OF CONTENTS 



^ CHAPTER 1 

r* APPROACHING YOUR APPLE 



: 1 1 1 i 

3 Till MMN BOARD 

\PPI_E 

rHI Kl YBOARD 

R | . KEYBO I 

lilt APPLE VII "i O 

9 1IIL VIIH 01 ONNI I 

[0 EURAPPI E 150 HZ) MOD1FK *TlON 

i \r 

12 Si HI I N MEM 

[2 Si ^CifcS 

12 St REEN SWTTI 

14 rill 1 1 \ I MOl 

|7 Illi LOW 

19 [in IIIGH-RESOLI 

iPI VKER 

NUN! lATi 
Hi I INPI 

,ii| \PPI 

VRD 

n mi M'l'l I II l'l i S 



CHAPTER 2 

CONVERSATION WITH APPLES 



in i 
30 Till STOP- il HI 

. WHATI IGII 'I R WINI 

IOR i Mi 

.■■I I 

■ n 

36 III! i CLE 

16 A 

JPECI VI L(X MIONS 



CHAPTER 3 

THE SYSTEM MONITOR 



■ (III. MO! 

40 \ i ATA 

41 EXAMINING Till ( 

IOME MORI Ml MOM 
:■! Ml MOR> 
. 01 ALOi ■ 

moNs 

44 MOVING \ RANGI 01 MEMORY 

MEMORY 

INC \ R VNGI "| MINI' 
•1? R ■ I ROM I 

MIL MINI- ASS' 



td 



HI hi ClGINi wis 

I X VMINI? I II \NGING REGISTERS 

^ ' iCELI SNEOUS MONITOR COMMANDS 

t3 5PE( I \l IKh KS WITH HM MONITi 

CRI .1 I'"-' fO! :' ' >■•'• S I I 'MM \M)S 

IM MO "I MON < > i'MM \NUS 

'■i SOM F-UI MONI l"OR SI BROI I INP5 

MONI ' IM I m aiONS 

MINI VSSI MHI l R INSTRI I HON FORM Ms 



s.: 



■a 



mm 



- i 



CHAPTER 



4 



^ MEMORY ORGANIZATION 



61 



CHAPTER 5 

INPUT/OUTPUT STRUCTURE 






IIMII -\i W 

IPHFRAL i \< I 

■■: [>| RIPHI I' \l SI 01 ■■< K \K HP A 13 R \M 
ITI III S 
|i >N ROM 



CHAPTER 6 

HARDWARE CONFIGURATION 



m 
90 riMINCi 

92 POWI K si'ITl V — 

94 ROM Ml Mi — 

9fi mt vi 5 

in I i M 

' IPI R — 

niEGAM] KIR 

E 

in? KEYBO VRDI I »NNI I 

'Ml R| \< I J ' g- 

■ IR C 

105 si'l \kl R 

PI RIPII1 R \l i i INNI (. TORS 






^ '" APPENDIX A 

=3 THE 6502 INSTRUCTION SET 

^ ' APPENDIX B 

5 SPECIAL LOCATIONS 

Si 



Si 






APPENDIX C 
ROM LISTINGS 






GLOSSARY 



185 



BIBLIOGRAPHY 



INDEX 



\ hi I IGI 
INDI V i 'I PH< 

I Mil l S 
RA< N RS 



— INTRODUCTION 



This is ihe User Reference Manual for the Apple II und Apple II Plus personal computers. Like 
ihe Apple itself, ihis book is a lool. As wilh all tools, you should know a little about it before 
you start to use it. 

This book will not leach you how to program. It is a book of facts, not methods. If you have 

just unpacked your Apple, or you do not know how to program in any of the languages available 

"^ for It, then before you continue with ihis book, read one of the other manuals accompanying 

— your Apple. Depending upon which variety of Apple you have purchased, you should have 

■*J received one of the following: 

*_^ Apple II BASIC Programming Manual 

(part number A2L0005) 

— The Applesoft Tutorial 

<parl number A2L0O18) 

These are tutorial manuals for versions of the BASIC language available on the Apple. They also 

JJ include complete instructions on setting up your Apple. The Bibliography at the end of this 
manual lists other books which may interest you. 

— ' There are a few different varieties of Apples, and this manual applies to all of them. It is possible 
that some of the features noted in this manual will not be available on your particular Apple. In 

lm places where this manual mentions features which are not universal to all Apples, it will use a 
footnote to warn you of these differences 

TS This manual describes the Apple II computer and its parts and procedures. There are sections on 
the System Monitor, the input/output devices and their operation, the internal organisation of 

2i memory and input/output devices, and the actual electronic design of the Apple itself. I-'or infor- 
mation on any other Apple hardware or software product, please refer to the manual accompany- 

^ m ing that product. 






- 



CHAPTER - 

APPROACHING YOUR APPLE 



2 THI POWER SUPPLY 

3 THE MAIN BOARD 

4 TALKING TO YOUR APPLE 

5 THI KEYBOARD 

6 READING THE KEYBOARD 
4 THE APPLE VIDEO DISPLAY 

9 I HE VIDEO CONNECTOR 

10 EURAPPLE (50 HZ) MODIFICATION 
10 SCREEN FORMAT 
12 SCREEN MEMORY 
12 SCREEN PAGES 
12 SCREEN SWI I (II is 
14 THE TEXT MODI 

17 THE LOW- RESOLUTION GRAPHICS (LO-RES) MODE 

19 THE HIGH-KI SOU TION GRAPHICS (HI-RES) MODE 

20 OTHER INPUT/OUTPUT FEATURES 
20 THE SPEAK IK 

22 THE CASSETTE INTERFAt I 

23 THE GAME I/O CONN! ■.< !< 'K 

23 ANNUNCIATOR OUTPUTS 

24 ONE-BIT INPUTS 

24 ANALOG INPUTS 

25 STROBE OUTPUT 
25 VARIETIES OF APPLES 

25 AUTOSTART ROM / MONITOR ROM 

26 REVISION / REVISION 1 BOARD 

27 POWER SUPPLY CHANGES 
27 THI APPLE II PLUS 



For detailed information on setting up your Apple, refer lo Chapter I of either the Apple BASIC 
Programming Manual or The Applesoft Tutorial 

In this manual, all directional instructions will refer to this orientation: with the Apple's 
typewriter-like keyboard facing you, "front"' and "down" are towards the keyboard, "back" and 
"up" arc away. Remove the lid of the Apple by prying up the back edge until it "pops", then 
pull straight hack on the lid and lift it off. 

This is what you will sec 



Power Supply 



Speaker 




Main Board 



Photo I. The Apple II. 



THE POWER SUPPLY 



The metal box on the left side of the interior is the Power Supply. It supplies four voltages: 
+ 5v. —5 2v, +11. 8v. and — 12. Ov. It is a high-frequency "switching"-lype power supply, with 
many protective features to ensure thai there can be no imbalances between the different sup- 
plies. The main power cord for the computer plugs directly into the back of the power supply. 
The power-on switch is also on the power supply itself, to protect you and your lingers from 
accidentally becoming part of the high-voltage power supply circuit. 



flnppfcx computer mc 



MODfL 43U001 
tor ill *C 

40 ><• 





1 10 voli model 1 10/220 volt modi 

Photo 2. The back of Ihe Apple Power Supply. 

THE MAIN BOARD 



The large green printed circuit board which lakes up mosl of the bottom of the case is the com- 
puter itself. There are two slightly different models of ihe Apple II main board: the original 
(Revision 0* and the Revision I board. The slight differences between the two lie in the elec- 
tronics on the board. These differences are discussed throughout this book. A summary of the 
differences appears in the section "Varieties of Apples" on page 25. 

On this board there are about eighty integrated circuits and a handful of other components. In 
the center of the board, just in front of the eight gold-toothed edge connectors ("slots"! ai the 
rear of the board, is an integrated circuit larger than all others. This is the brain of your Apple 
It is a Synerlek/MOS Technology 6502 microprocessor. In the Apple, it runs at a rate of 
1.023,000 machine cycles per second and can do over five hundred thousand addition or subtrac- 
tion operations in one second. It has an addressing range of 65,536 eight-bit bytes. Us repertory 
includes 56 instructions with 13 addressing modes. This microprocessor and other versions of it 
are used in many computers systems, as well as other types of electronic equipment. 

Just below the microprocessor are si\ sockets which may be filled with from one to six slightly 
smaller integrated circuits. These ICs are the Read-Only Memory (ROM* "chips" for Ihe Apple. 
They contain programs for the Apple which arc available the moment you turn on the power. 
Many programs are available in ROM. including the Apple System Monitor, the Apple Autostart 
Monitor, Apple Integer BASIC and Applesoft II BASIC, and the Apple Programmer's Aid U I util- 
ity subroutine package. The number and contents of your Apple's ROMs depend upon which 
type of Apple you have, and the accessories you have purchased. 

Right below the ROMs and the central mounting nut is an area marked by a white square on the 
board which encloses twenty-four sockets for integrated circuits. Some or all of these may be 
filled with ICs. These arc the main Random Access Memory (RAM) "chips" for your Apple. 
An Apple can hold 4,0% to 49.152 bytes of RAM memory in these three rows of components.* 
Each row can hold eight ICs of either the 4K or I6K variety. A row must hold eight of the same 



" You ctfl extend your RAM memorj to 64K h> purchasing ihe Apple UingiMfic ('aril, pari o) the Apple 
Language System (pari number A2B0OW.) 



lype of memory components, but the two types can both be used in various combinations on 
different rows to give nine different memory sizes." The RAM memory is used to hold all of the 
programs and dula which you are using at any particular time. The information stored in RAM 
disappears when the power is turned oil" 

The other components on the Apple II board have various functions: they control the flow ot 
information from one pari of the computer to another, gather data from the outside world, or 
send information to you by displaying it on a television screen or making a noise on a speaker. 

The eight long peripheral slots on the back edge of the Apple's board can each hold a peripheral 
card [0 allow you to extend your RAM or ROM memory, or to connect your Apple to a printer or 
other input/outpul device. These slois are sometimes called the Apple's "backplane" or 
"mother hoard" 



TALKING TO YOUR APPLE 

Your link to your Apple is at your fingertips. Most programs and languages thai are used with 
the Apple expect you to talk to them through the Apple's keyboard. It looks like a normal type- 
writer keyboard, except lor some minor rearrangement and a few special keys. For a quick 
review on the keyboard, see pages 6 through 12 in the Apple II BASIC Programming Manual 
or pages > through 1 1 in The Applesoft Tutorial. 

Since vou're talking with your fingers, you might as well be hearing with your eyes. The Apple 
will tell you what it is doing by displaying letters, numbers, symbols, and sometimes colored 
blocks and lines on a black-and-white or color television sei 



' The Apple II is .IcsiuntU in me both the I6K urul ihc k-ss BXpOfliive -IK RAMS lln*cvci, iluc to ihc givaici 

ivathbflli) ind reduced cost <>t it": it»K chips, -\pp\c no* supplies only ihc tf>K RAMi 



THE KEYBOARD 



The Apple Keyboard 










Number of Keys: 


>: 








Coding: 


Upper 


'.hL' ASCII 




Number of codes: 


91 








Output: 


Seven bits, plus 


si robe 




Power requirement: 


- Si .! 

-I2v 


1 20mA 
t 50mA 






Rollover 


2 kej 








Special keys. 


CTRL 
ESC 
RESET 
REPT 








Memory mapped locations: 


Data 
Clear 


Hex 

SCiMfl 

SC010 


Decimal 
49152 
49168 


-16384 
-16368 



The Apple II has a built-in 52-key typewriter-like keyboard which communicates using the Amer- 
ican Standard Code for Information Interchange (ASCII)". Ninely-one of the 96 upper-case 
ASCII characters can be generated directly by the keyboard. Table 2 shows the keys on the key- 
board and their associated ASCII codes. "Photo" 3 is a diagram of the keyboard. 

The keyboard is electrically connected to the main circuit board by a 16-conductor cable with 
plugs at each end that plug into standard integrated circuit sockets. One end of this cable is con- 
nected to the keyboard: the other end plugs into the Apple board's keyboard connector, near the 
very front edge of the board, under the keyboard itself. The electrical specifications for this con- 
nector are given on page 102. 

Most languages on the Apple have commands or statements which allow your program to accept 
input from the keyboard quickly and easily (for example, the INPUT and GET statements in 
BASIC). However, your programs can also read the keyboard directly. 



" All ASCII codei used h> the Apple normdll) have ihcii high tm sci This ts the tattK js standjrU murk- 

parlti vscii 



1 l : l;l;i;^l;l;l;l;l;l 
1 I i i ■ ^ i i i i i i 

I ° y "°" I H ' ~" I ' 1 1 



■i >i i "i 1 "» 



t^~V \ 



••Pholo" 3. The Apple Keyboard. 



READING THE KEYBOARD 



The keyboard sends seven bius of informaiion which togeiher form one character. These seven 
bits, along wilh anolher signal which indicates when a key has been pressed, are available to most 
programs as ihc contents of a memory location. Programs can read the curreni state of the key- 
board by reading the contents of this location. When you press a key on the keyboard, the value 
in this location becomes 128 or greater, and the particular value it assumes is the numeric code 
for the character which was typed. Table 3 on page 8 shows the ASCII characters and their asso- 
ciated numeric codes. The locution will hold this one value until you press another key. or until 
your program tells the memory location to forget the character it*s holding. 

Once your program has accepted and understood u keypress, it should tell the keyboard's memory 
location to "release" the character it is holding and prepare to receive a new one. Your program 
can do this by referencing anolher memory location. When you reference this other location, the 
value contained in the first location will drop below 128. This value will stay low until you press 
another key. This action is called "clearing the keyboard strobe". Your program can either read 
or write to the special memory location, the data which are written to or read from that location 
are irrelevant. It is the mere reference to the location which clears the keyboard strobe. Once you 
have cleared the keyboard strobe, you can still recover the code for the key which wus last 
pressed by adding 128 thexadecimal $80) to the value in the keyboard location. 

These are the special memory locations used by the keyboard: 



Tabic 1 : 


Keyboard Special Locations 


Location 

\\c\ 


Decimal 


Descriplion 


Si HM 


49152 


-16384 


Keyboard Data 


S< '¥! 1 fl 


49168 


-10368 


Clear Keyboard Strobe 



The 1 RESET I key at the upper right-hand corner does not generate an ASCII code, but instead is 
directly connected to. the microprocessor. When this key is pressed, all processing slops. When 
the key is released, trie computer starts a reset cycle. See page 36 for a description of the RESET 



function. 

The ICTRLl and [SHIFT I keys generate no codes by themselves, bul only alter the codes produced 
by other keys 



The 1RKPT] key. if pressed .done, produces a duplicate of the last code that was generated. If you 
press and hold down the [ RE I'll key while you are holding down .1 character key. n will act as iT 
you were pressing thai kej repeatedly at a rale of 10 presses each second. This repetition will 
Cease »hen you release either the character key or jREPTl . 



The POWER light at the lower left-hand corner is an indicator lamp to show when the power lo 
the Apple is on. 







Tabic 2: Keys 


and Th 


ir Associated ASCII Codes 






Key 


Alone 


CTRL 


SHIFT 


Both 


Key 


Alone 


CTRL 


si nil 


ii,.:h 


space 


SAW 


SA0 


SA0 


SA0 


RETURN 


S8D 


S8D 


S8D 


S8D 





SB0 


SB0 


SB0 


SB0 


G 


SG7 


S87 


SC7 


S87 


1! 


SB1 


SBI 


SA! 


SAI 


II 


SC8 


S88 


SC8 


S88 


2" 


$B2 


SB2 


SA2 


SA2 


I 


SC9 


S89 


SC9 


S89 


3# 


SB3 


SB3 


SA3 


SA3 


J 


SCA 


S8A 


SCA 


58A 


4S 


SB4 


SB4 


SA4 


SA4 


K 


SCB 


S8B 


SCB 


$811 


5% 


SB5 


SB5 


SAS 


SAS 


L 


see 


SBC 


sec 


S8C 


6& 


SB6 


SB6 


SAh 


SA6 


M 


SCO 


S8D 


SDD 


S9D 


r 


SB7 


SB7 


SA7 


SA7 


N" 


M 1 


581 


SDE 


S9E 


8< 


SB8 


SB8 


SA8 


SAS 





SCI 


S8I 


SCF 


S8F 


9) 


SB9 


SB9 


SA9 


SA9 


p@ 


SD0 


S90 


SC0 


S80 


;- 


$BA 


SBA 


SAA 


SAA 





SD1 


S9I 


SDI 


S9| 


;+ 


SBB 


SBB 


SAB 


SAB 


R 


SD2 


S92 


$02 


S92 


.< 


SAC 


SAC 


SBC 


SBC 


S 


SD3 


S93 


$03 


S93 


— ■ 


SAD 


SAD 


SBD 


SBD 


T 


SD4 


S94 


SD4 


S94 


> 


SAE 


SAE 


SBE 


SBE 


U 


$05 


S95 


$D5 


595 


/? 


SAF 


SAF 


SBF 


SBF 


V 


SD6 


S96 


SD6 


596 


A 


SCI 


SSI 


SCI 


$81 


w 


$07 


S97 


SD7 


S97 


B 


SC2 


ss: 


SC2 


S82 


X 


SD8 


S98 


SD8 


S98 


C 


SC3 


S83 


St 3 


S83 


Y 


SD9 


S99 


$D9 


S99 


D 


SC4 


S84 


SC4 


S84 


z 


SDA 


S9A 


SDA 


S9A 


E 


SC5 


S85 


SC5 


S8> 


— 


S88 


S88 


S88 


S8K 


F 


» fi 


S86 


SC6 


S86 


— 


S95 


S95 


S95 


S95 












ESC 


S9B 


y>B 


S9B 


S9B 



All codes are given in hexadecimal To find the decimal equivalents, use Table 3. 







Table 3: 


The ASCII Character 


Sel 






Dec mal: 


)?8 


144 


H>0 


176 


192 


20S 


224 


"-ivi 





Hex: 
S0 


S80 


S90 


SA0 


siw 


SC0 


SD0 


$1:0 


SF0 


nul 


die 







@ 


P 




P 


1 


SI 


soh 


del 


i 


1 


A 





a 


q 


1 


S2 


stx 


de2 


" 


2 


11 


R 


b 


r 


} 


S3 


etx 


dc3 


# 


3 


C 


s 


c 


s 


J 


S4 


eoi 


dc4 


s 


4 


n 


T 


d 


I 


> 


S5 


enq 


n, ik 


'■■ 


5 


I- 


l> 


e 


u 


h 


S6 


ack 


syn 


& 


6 


i 


V 


f 


V 


7 


S7 


hel 


eib 




7 


G 


w 


B 


w 


a 


S8 


bs 


can 


( 


8 


II 


X 


h 


X 


9 


S9 


hi 


em 


) 


9 


1 


Y 


i 


y 


10 


SA 


If 


sub 


• 


: 


J 


Z 


J 


/ 


ii 


SB 


vt 


CSC 


- 


; 


K 


1 


k 


1 


i? 


SC 


ff 


fs 




< 


L 


\ 


i 




13 


SD 


cr 


&s 


- 


= 


M 


1 


ni 


1 


14 


SE 


so 


rs 


. 


> 


N 




n 




15 


SF 


si 


us 


/ 


7 





- 





rub 






Groups of iwo and ihree lower case letters are abbreviations for standard ASCII control charac- 
ters. 

Not all the characters listed in this table can be generated by the keyboard. Specifically, the char- 
acters in the two rightmost columns (the lower case letters), the symbols [ (left square bracken, 
(backslash), _ (underscore), and the control characters "fs". "us", and "rub", are not available 
on the Apple keyboard. 

The decimal or hexadecimal value for any character in the above table is the sum of the decimal 
or hexadecimal numbers appearing at the lop of the column and the left side of ihe row m which 
the character appears. 



cr 



THE APPLE VIDEO DISPLAY 



The Apple Video Display 


Display type: 


Memory mapped into system RAM 


Display modes: 


Text, Low-Resolution Graphics, 

High-Resolution Graphics 


Text capacity: 


960 characters (24 lines, 40 columns) 


Character type: 


5 x 7 dot matrix 


Character set: 


Upper case ASCII, 64 characters 


Character modes: 


Normal, Inverse, Flashing 


Graphics capacity: 


1.920 blocks (Low-Resolution) 

in a 40 by 48 array 
53,760 dots (High-Resolution) 

in a 280 by 192 array 


Number of colors: 


16 (Low-Resolution Graphics) 
6 (High-Resolution Graphics) 



THE VIDEO CONNECTOR 



In the right rear corner of the Apple II board, there is a metal connector marked '"VIDEO". 
This connector allows you to attach a cable between the Apple and a closed-circuit video monitor. 
One end of ihe connecting cable should have a male RCA phono jack to plug into the Apple, and 
the other end should have a connector compatible with the particular device you are using. The 
signal that comes out of this connector on the Apple is similar to an Electronic Industries Associ- 
ation <ElA)-standard ( National Television Standards Committee (NTSO-compatible. positive 
composite color video signal. The level of this signal can be adjusted from zero to 1 volt peak by 
the small round potentiometer on the right edge of the board about three inches from ihe back of 
the board. 

A non-adjustable. 2 volts peak version of Ihe same video signal is available in two other places: 
on a single wire-wrap pin" on the left side of the board about two inches from the back of the 
board, and on one pin of a group of four similar pins also on the left edge near the back of the 
board. The other three pins in this group are connected to —5 volts. +12 volts, and ground. 
See page 97 for a full description of this auxiliary video connector. 



This pin b not pccscnl m Apple II gystemi *uh ihe Revision fl board 




Auxiliary Video 
Output Connector 



Auxiliary Video Pin 



Level Adjustment 
Potentiometer 



Color Trim 
Adjustment 



Photo -J. The Video Connectors and Potentiometer. 

EURAPPLE (50 HZ) MODIFICATION 



Vour Apple can be modified to generate a video signal compatible with ihe CCIR standard used 
En mans European countries. To make this modification, just cut the Iwo X-shaped pads on the 

right edge of the hoard about nine inches from the back ol the board, and solder together the 
three O-shaped pads in the same location-, (see photo 5), You can then connect Ihe video con 
nector ol youi Apple to a European standard closed-circuit black-and-white or color video moni- 
tor, II you wish, you can obtain a "Eurocolor*' encoder to convert the video signal into a PAL or 
si ( am standard color television signal suitable for use with any European television receiver, 
The encoder is a small printed circuit board winch plugs into the rightmost peripheral slut (slot 71 
in your Apple and connects to the single auxiliary video output pin. 



\\ MINING: tins modification will void the warrant) on your Apple and repines 
the installation of a different main crystal, fhi's modification Mini for beginners. 



SCREEN FORMAT 



Three different kinds ol information can be shown on the video displfl) 10 which your Apple is 
connected 



ID 



3 
% 
5 
^s 
^ 



■9 

: --■ 

1 




jumper puds 



Pholu 5. Eurapplt- (50 hz) Jumper Pads. 

I» Text Hie Apple can display 24 lines of numbers, special symbols, and upper-case letters 
With 40 of these characters on each line. These characters are formed in a dol matrix 7 dots 
high and 5 dots wide. There is a one-dol wide space on either side of the character and d one- 
dot high space above each line. 

2) Low-Ri'solulinn Graphics The Apple can present l.*>20 colored squares in an array 40 
blocks wide and 48 blocks high The color Of each block can he selected from ■ sol ol sixteen 
different colors. There is no space between blocks, so lhat any two adjacent blocks of Ihe 
same color look like a single, larger block 

M High-Resolution Graphics. The Apple can also display colored dots on a matrix 280 dots 
wide and 192 dols high. The dOIS are the same size as ihe dots which make up ihe Text char- 
acters. There are six colors available in the High- Resolution Graphics mode; black, while, red. 
blue, green, and violet." Each dot on the screen cun be either black, white, or a color, 
although not all colors are available for every dol. 

When the Apple is displaying a particular type of information on the screen, it is said lo he in 
lhat particular "mode". Thus, if von see words and numbers on the screen, you can reasonably 
he assured that your Apple is in Text mode. Similarly, if you sec a screen full of multicolored 
blocks, your computer is probably in Low-Resolution Graphics mode. You can also have a four- 
line "caption" of text at the bottom of either type of graphics screen These four lines replace 

iplea with Revision fl bnurcK there ire (out colon black, while green, .in J vig|et 



II 



(he lower 8 rows of block-, in Low-Resolution Graphics, leaving a 40 h> 40 array In High- 
lulion Graphics, they replace the boiiom 32 rows of dots, leaving b 280 by 160 matrix ^ ou 
can use ihese "mixed modes" to display text and graphics simultaneously, but there is no was to 
display both graphics mode* at the same lime. 



SCREEN MEMORY 

The video display uses Information in the system's RAM memory to generate its displaj The 
value of a single memory location controls the appearance of a certain, fixed object on the screen 
This object can be a character, two stacked colored blocks, or a line of seven dots. In Text and 
Low-Resolution Graphics mode, an area of memory containing 1,024 locations is used as the 
source of the screen information. Text and Low-Resolution Graphics share this niemor\ area. In 
High-Resolution Graphics mode, a separate, larger area (8.192 locations) is needed because ol 
Ihe greater amount of information which is being displayed. Thee areas of memor\ are usually 
called "pages" Ihe area reserved lor High-Resolution Graphics is sometimes called the "picture 
buffer" because it is commonly used to store a picture or drawing, 



SCREEN PAGES 



There are actually iwo areas from which each mode can draw its information. The BrSl 
called the "primary page" or "Page I" The second area Is called the "seconder) pag* 01 
"Page 2 " and is an area of the same sue immediately following the first area. The secondary 
page is useful for storing pictures or text which you want to he able to display instantly A pro- 
gram can use ihe two pages to perform animation by drawing on one page while displaying the 
other and suddenly flipping pages 

rexl and Low-Resolution Graphics share the same memory range for ihe Seconder) page, 

-hare the same range for the primary page Both mixed modes which were described above 
are also available on the secondary page, hut there is no way 10 mix the two pages on the same 
screen. 



I.,M, 4. \ iik-M Display Mun-m Kaugis 



Screen 



Page 



Begins at 
Ilex 



Ends at 



Decimal 



TeM/Lo-Res 



Primary 
Seconder) 



S400 
S800 



1024 
2048 



S7I-F 
SBFF 



2047 
3071 



Hi- Res 



Primary 
Secondary 



S2PHW 

$4000 



8192 

163X4 



S3FFF 

SMIT 



16383 
2457? 



SCREEN SWITCHES 

The devices which decide between the various modes, pages, and mixes are called "soli 
switches". They are switches because they have two positions (foi example; on or off, text or 
graphics) and they are called "soft" because they are controlled by the software of the computer. 



i: 



A program can "throw ' a switch by referencing ihe special memory location for that switch, [he 
data which arc read from or written to ihe location arc irrelevant; it is the reference u< the address 

of ihe location which throws ihe swilch. 

There .ire eight special memory locations which control the selling of the soft switches For the 
screen. They are sel up in pairs: when you reference one location of the pair you lurn its 
corresponding mode "on" and its companion mode "01P. The pairs are: 







TableS; 


Screen Soft Snitches 


Locatior 
Ilex 


Decimal 




Description 


SC050 
SC051 


49232 
49233 


-16304 
-16303 


Display a GRAPHICS mode. 
D»splu\ 1 liXT mode. 


SCtfSl 


49234 
49235 


-16302 
-16301 


Display all TEXT or GRAPHICS. 
Mix TEXT and a GRAPHICS mode.' 


St 054 
S< B55 


49236 
49237 


-16300 
-16299 


Display the Primary' page (Page 1). 
Display the Secondary page (Page 2). 


SC056 
SC057 


49238 
49239 


-16298 
-16297 


Display LO-RES GRAPHICS mode.' 
Display HI-RES GRAPHICS mode. 4 



There are ten distinct combinations of these swiiches: 



Tabic 6: Screen Mode Combinations 


Primary Page 


Secondary Pane 


Screen Switches 


Screen Switches 


All Text SC054 SC051 


All Text SC055 SC05I 


All Lo-Rcs SC054 SC056 
Graphics SC052 SC050 


All Lo-Res SC055 SC056 
Graphics SC052 SC050 


All Hi-Res SC054 SC057 
Graphics SC052 SC050 


All Hi-Res SC055 SC057 
Graphics SC052 SC050 


Mixed Text SC054 SC056 
and Lo-Res SC053 SC050 


Mixed Text SC055 SC056 
and Lo-Res SC053 SC050 


Mixed Texi SC054 SC057 
and Hi-Res SC053 SC050 


Mixed Text SC055 SC057 
and Hi-Res SC053 SC050 



(Those of you who are learned in the ways of binary will immediately cry out. "Where's the 
other six?!", knowing Tull well thai with 4 two-waj switches Ihere arc indeed sixteen possible 
combinations. The answer to the mystery of the six missing modes he* in the 
TEXT /GRAPHICS switch. When the compuier is in Texi mode, ii can also be in one of six 
combinations of ihe Lo-Res/Hi-Res graphics mode, "mix" mode, or page seleciion. But since 
ihe Apple is displaying lext. these diflercm graphics modes are invisible.) 

To set the Apple into one of ihese modes. ,1 program needs only to refer 10 the addresses of ihe 
memory locations which correspond 10 the switches that sei lhal mode. Machine language pro- 
grams should use the hexadecimal addresses given above; BASIC programs should I'll K or 
POKE their decimal equivalents (given in Table 5, "Screen Soft Swiiches". above!. The 
switches may be thrown in any order; however, when switching into one of the Graphics modes, 
il is helpful to throw the TEXT/GRAPHICS switch last. AH ihe oihcr changes in mode will then 
lake place invisibly behind ihe text, so lhal when ihe Graphics mode is sel. ihe finished graphics 

• Thc« mod« ire unit) viMblc 11 itn Dupbj OH u'iik^v switch 1* "nn" 



13 



screen appears 



s all at once 



THE TEXT MODE 

In the Tcxl mode. Ihe Apple c,,, dlspla, 24 lines of characters with up >«j 40 ^^nM«A 
line Each character on (he screen represents .he contents "I one memory location from Ihe 
memory range of .he page being displayed The character set meludes .he 26 "^-^ ,eHe "; 
,he 10 digits, and 28 special characters for a .Otal of 64 character! I he characters .arc rn .d ,n u 
ool main. 5 dots wide and 7 do,, high. There is a one-do. wide space on b«h «fa lof _Mrt 
character .0 separate adjacent characters and ., one-dol h.gh space above each ne tTitaMMH 
separate adjacent lines, The characters are normally formed wrth whhe dots on a dark back- 
ground: however, each character on Ihe screen can also be delayed using ^Wsonawhrie 
background or alternating between the two lo produce , Hasrung ctoacle When the Video 
D.splav is in Text mode, .he video circuiirj In the Apple .urns oil Ihe color bursl signal lo .he 
television monitor, giving you a clearer black-and-white display 

The area of memory which is used for .he primary .ex. page SUtrlS a. tKtffal number l«4 and 
extends ... location number 28*7 The secondary screen begins .,. location "MtarlMind 
extends up w location 3B7I. In machine language, ihe primary page ,s Iron, heiradecimal address 
£&" ddrass |7FR the secondarj Page is from SS00 ,o SUIT. Each these Pages m. 1 .024 
hv.es long I hose of you intrepid enough lo do ihe mulopheaiion will reaUze .ha, .her. are only 
9h0 characters displayed on .he sereen. The remaining 64 bytes In each ■*!» « «« 
displayed on the sereen are used as temporary storage locations by programs s.ored in PROM on 
Apple Inlelligen. Interface peripheral boards .see page 821 

Pholo 6 shows Ihe sixty-four charaelers available on Ihe Apple's screen. 



eABCDEFGHIJKLMNO 
PQRSTUUWXYZCN]*- 

! » * $ % & § < >*+*-•' 

9123456789 ! i < = > ? 



Pholo 6. The Apple (haracler Set. 

I 

Table 7 gives ihe decimal and hexadecimal codes lor .he 64 characters in normal, inverse, and - 
flushing display modes 



■ Thisicjim sseni on Ihe Revision » bontd. 



14 









1 


5 


— 


S_rs<-tTW- 1 -OP-aO» - - *-V 9 A *" 




B 










I 










_ 


■1 
-■ 
"J 


-- 
_ 


— = ttvi^^J- ---+ • | ■ ^ 






a 


g 

Iff 


0- o K i^ h D > J X >- N — ^-_. i 








5. 
_ 


@<cdOQujxo = » « -J 2 2 O 




! 










_ 










* 


■f 




8_nnt^«r-«» ■■ -• V 1 A~' 




t/i 










u 










0) 

•- 


— 








u 
n 




















-■ 


■ 


B.QK^hD>JX^N — -" — ■ i 




•= § 






















©<couQ-ii-OX . * _j S 2 O 




O 










4* 

I- 
CI 










r. 


■ 


s_^i^- T u%or~aoCT' -V II A ^ ■ 




s 




M 






M 










U 2 


c 


I 


-= >t V> ? <« ' — — • + -1 ^ 




^ 










•< e 


1 


■ 


a. O qc c/i h- D > ? x >• r*J — -- — ■ 




h* 










o> 


2 


3 


&}<muO^-j-'0^ — - , ^— ) 2 Z O 












.a 










«• 










cd 










H 


4C 




^ — r-jr-i*»w-.^f^ooiy - ■ -V || A - 




El 


•*! 




-. = % «/> £ <f . - - . + - 1 ^ 






















c 












C 


■ 


a.O , o£coh-D>? x >- r%j — ^- — . 
@)<fflOC"Jli.OI- -» a«! -I S 2 O 




- 


« — r. -. * vj * •- ww < m O 3 -; -^ 






3 








V 























I 






15 






30 



no s GO >» -^ >•*■ ~* j Tl 



iilliislisiaiissiaatsiass 



3 
I 

S 
6 

7 

I 

9 

ii 
tl 
13 

13 

14 

13 

It 
IT 



Ml 
Si-: 
S03 

m 

MS 

sw, 

M? 

sw 

S»9 
S0A 

S»B 
SKT 

S#P 
Mb 
MF 

SI* 
111 



18 S1J 

19 SI3 



H 
21 
22 
13 

24 

: ( 
It 

27 
II 

29 
.IB 
II 
.12 
33 
34 
35 
M 
jl 
31 

n 



114 

SIS 

SI6 

SI7 

SIS 

Sl9 

SI A 

SIB 

SIC 

SID 

Sit 

S1F 

S2t 

121 

S22 

S23 

S24 

s:- 

S26 

s:' 



|6 



■2 
= 

= 
- 

m 

= 
= 



Rgure I is a map of ihe Apple"* dhphy '» Tc *' mode - *' lh lhc ""-' ml,r > locallon addresses lor 
each charactei position on ihe screen. 



THE LOW-RESOLUTION GRAPHICS (LO-RES) 
MODE 

In ihe Low-Resolution Graphics mode, the Apple presents the contents ol the same 1,024 loca- 
tions m| memor> as is m ihe Texi mode, hut in a different formal In this mode, each byte 01 
memory is displayed nol as an ASCII Character, hut as IWO Colored blOCKS, slacked one atop the 
Other The screen can Show Bfl arraj of blocks 40 wide and 48 high Each block can be any ol 
sixteen colors. On a black-and-white television set, ihe colors appear as patterns of grey and 
while d< 

Since each byte in ihe page of memory for Low-Resolution Graphics represents two blocks on ihe 
screen, slacked vertically, each byte is divided mm IWO equal sections, called (appropriately 
enough) "mbbles" Each nybble can hold a value from zero to 15 The value which is in ihe 

nybble of Ihe byte determines lhc color for ihe upper block of that byle on the screei 
the value which is in the upper nybble determines ihe color for ihe lower block on ihe screen 
The colors are numbered zero to 15. thus: 





Tabic 8: Low-Rcsolu 


ion (iraplii 


cs Colo 


rs 


Decimal 


Ilex Color 


Decimal 


Hex 


Color 





Black 


8 


S8 


Brown 


1 


SI Magenta 


9 


S9 


Orange 


2 


$2 Dark Blue 


10 


v\ 


drey 2 


3 


S3 Purple 


11 


SB 


Pink 


4 


S4 Dark Green 


12 


sc 


Light Green 


5 


$5 Grey 1 


13 


SD 


Yellow 


6 


$6 Medium Blue 


14 


SE 


Aquamarine 


7 


S7 Light Blue 


15 


SF 


White 



(Colors mav vary from television to television, particularly on those without hue controls You 
can adjust the tint of ihe colors by adjusting the COLOR TRIM control on the right edge of the 
Apple hoard. I 

So, ii byte containing the hexadecimal value SD8 would appear on ihe screen as ., brown block on 
top of a yellow block. Using decimal arithmetic the color of ihe lower block is delermined by 
Ihe quotient of the value of the byte divided b> 16; the color of the upper block is delermined b> 
the remainder 

Rgure 2 is ., map of the Apple's display in Low-Resolution Graphics mode, with the memory 
location addresses for each block on the screen. 

Since the Low- Resolution Graphics screen displays the same area in memory as is used for ihe 
Text screen, interesting things happen if you switch between the Te\t and Low- Resolution 
Graphic- modes For example, If the screen Is m ihe Low-Resolution Graphics mode and is full 
of colored blocks, and then the TEXT/GRAPHICS screen switch Is thrown to the Text mode, the 
screen will be rilled with seeminglv random lexl characters, sometimes inverse or flashing. Simi- 
larly, a screen full of lexl when viewed in Low-Resolution Graphics mode appears as long hor- 
izontal grey. pink, green or yellow bars separated by randomly colored blocks. 



17 









■s- 



-s 



-J-. 



X 



dc 



Oo 



z^ 



DC 



OO "S- ^1 "S. 9 S ^ S S 



S CO nI 9s ^ U 

St — i 4* - ooa 

OS to 4> C* OO _5 



NJ — 
_- ® 
ho 4> 



'O « ^J Ui 

O (*J S ^J 



4<Nj<oosr>j<oi>ujsooLnM 



! 










::: :::::: 








1 1 








































■ t ,,._._ i . . , 




------------- - - 


_ _ ______ 


' • ' M * I H 






"*" 


- 




1 . < 1 i 1 



• 


MM 


I 


wi 


? 


w: 


3 


S#3 


i 


W4 


s 


S#5 


* 


sw> 


T 


M<" 


8 


M<- 


$ 


W o 


1/ 


S»A 


II 


MB 


13 


S* 


11 


»1> 


14 


m 


15 


»i 


16 


51* 


17 


$ii 


Id 


SI? 


w 


SI 3 


.V 


SIJ 


:i 


SIS 


12 


Slfr 


:.* 


S17 


:a 


SIX 


: ; 


SIO 


26 


SIA 


r 


SIB 


:n 


SIC 


m 


sm 


i# 


Sll 


3) 


su 


32 


s:# 


n 


521 


M 


s:: 


.IV 


5? 3 


/' 


S24 


37 


S2S 


II 


5M 


19 


527 



Figure 2. Map or ill? Lon-Kesnlulitin Graphics Mutle 



18 






- 



4 



THE HIGH-RESOLUTION GRAPHICS (HI-RES) 
MODE 

The Apple has .1 second type of graphic display, called High-Resoluiton Graphics lor sometimes 
H-rcS"), When your Apple is in the High-Resolution Graphics mode, it can display 53,760 

v TfiO Hnli- tuiila i.ml IOI H..ir li„.li I 1- . mmu* ..,,— fluinlan Ul„.-L- ..,!*.'•-, tilMtm 



in in '• *• mil juui r-\|i|>i«. 13 111 nil iii^M iiLtmuui"! » 11 .:|'i ii^ ■. Miimi., n idii wi--|'iiit -' .' . ryy 

dolS m a matrix 280 dots wide and 192 dots high. The screen can display black, "hue. 
green, red. and hlue dots, although there are some limitations concerning the color of individual 
aaj dots. 



The High-Resolution Graphics mode lakes its data from an 8, 192- byte area of memory, usually 
called n "picture butter". There are two separate picture buffers: one for the primary page and 
one for the secondary page. Both of these buffers are independent of and separate from the 

aaj memory areas used for Text and Low-Resolution Graphics. The primary page picture buffer for 
the High-Resolution Graphics mode begins at memory locution number 8192 and extends up lo 
location number 16383. ihe secondary puge picture buffer follows on the heels of ihe Hrsl at 
memory location number 16384, extending up to location number 24575 For ihose of >ou with 
sixteen fingers, ihe primary page resides from $2000 to S3I IT and the secondary page follows in 

aaj succession at $4000 to SSFFF. If your Apple is equipped with 16K. (16,384 bytes) or less ol 
memory, then ihe secondary page is inaccessible to you, if its memory size is less lhan I6K. then 

^ the entire High-Resolution Graphics mode is unavailable to you. 

Each dot on ihe screen represents one bil from ihe picture buffer Seven of the eighi bits in each 
byte are displayed on the screen, with the remaining bit used to select the colors of the dots in 
that byte Forty bytes are displayed on each line o\ the screen. The leusi significant bit (first bil) 
of the first byte in the line is displayed on the left edge of the screen, followed by the second bil. 
then the third, etc. The most significant (eighth) hit is not displayed. Then follows the lirsi hn 
of the next byte, and so nn. A total of 280 dots are displayed on each or the 192 lines of the 

screen. 

On a black-and-white monitor or TV set, the dots whose corresponding bits are "on" (or equal to 
I) appear white; the dots whose corresponding bits are "off" or (equal to 0) appear black. On a 
color monitor or TV, it is not so simple. If a bit is "off", its corresponding dot will always be 
black. If a bit is "on", however, its color will depend upon the position of that dol on the screen 
If the dot is in the leftmost column on the screen, called ■•column 0". or in any even-numbered 
column, then it will appear violet. If the dot is in the rightmost column (column 2791 or am 
odd-numbered column, then it will appear green. If two dots are placed side-by-side, the) will 
both appear while IT ihe undisplayed bil of a byte is turned on. then ihe colors blue and red arc 
substituted I'm violet and green, respectively.* Thus, [here are six colors available in the High- 
Resolution Graphics mode, subject 10 the following limitations: 

I) Dois in even columns must be black, violet, or blue. 

21 Dols in odd columns must be black, green, or red. 

3) Each byte must be either a violet/green byte or a hlue/red byte, it IS noi possible to mix 
green and hlue. green and red. violet and blue, or violet and red in the same byte. 



• On Revision tf Apple twenb, itie colon red una Hue arc unavailable ind ihe selling ol the utfhih bu Is ir- 
relevant 



19 



■J) Two colored dots side h\ side always appear whue. even if they are in different b\ies 

5) On European-modified Apples, ihcse rules apply bui ihe colors generated in ihe High- 

Resoluiion Graphics mode may differ ■— * 

Figure 3 shows the Apples display screen in High-Resolution Graphic-, mode wilh the memory 
addresses of each line on (he screen • 



OTHER INPUT/OUTPUT FEATURES 



Apple Input/Output Features 

Inputs: Cassette Input 

Three One-bit Digital Inputs 
Four Analog Inputs 

Outputs: Cassette Output 
Built-in Speaker 
Four "Annunciator" Outputs 
Ulility Strobe Output 



THE SPEAKER 



Inside the Apple's ease, on the left side under the keyboard, is a small K ohm speaker It is con- 
nected to ihe internal electronics of the Apple so thai a program can cause it to make \urious 

sounds. 

The speaker is controlled by a suit switch. The switch can put the paper cone of the speaker in 
Iwo positions "in" and "out". This soft switch is not like the soft switches controlling the vari- 
ous video modes, but is instead a foggh? switch Each time a program references the memory 
address associated with the speaker switch, the speaker will change slate; change from "in" to 
"oul" or vice-versa Each time the state is changed. Ihe speaker produces a liny "click" l*\ 
referencing the address of Ihe speaker switch frequently and continuously, a program can gen- 
erate a steady tone from the speaker 

The soft switch for the speaker is associated wilh memory location number 49200. Any reference 
to this address tor the equivalent addresses -16336 or hexadecimal 5C030) will cause the speaker 
10 emit a click 

A program can "reference" the address of the special location for the speaker b> performing a 
"read" or "write" operation to that address. The data which are read or written are irrelevant, as 
K is the address which throws the switch. Sole that a "write"' operation on the Apple's <>W 
microprocessor ictuall) performs a "read" before the "write", so that if you use a "write" 
operation to flip any soft switch, you will actually throw that switch twtce, For loggle-iype soli 
switches, such as ihe speaker switch, this means that a "write" operation to ihe special location 



i 



20 





































i 


■ 




5 

s 

<-- 


-r 




i— 
— 




-^. 
y 

;■ 
SJ 
4 




*■ 

r i 


5 

». 
-y 




8 

- 




Ill 


6t 
St 

U 
« 

<( 

H 

ff 
If 
If 
K 

a 

il 
« 

(I 

PC 

cr 
ii 
II 

« 

61 
II 
L\ 
91 

(1 

►1 
El 
II 
II 

01 
ft 
8 
l 
9 
( 

t 
I 
1 

• 




















































111 




















































sis 




















































«5 




















































US 




















































IIS 




















































III 




















































M 


















































c 

1 


JIS 


















































J1S 


















































in 


cm 


















































M 


3IS 


















































1c 
o. 

■ 


HIS 


















































V 11 


















































all 


















































•^ 


KIS 


















































B 
e 


. I\ 


















































3 


■*ll 


















































sis 


















































t/l 


HI 


















































a 


US 


















































£ 


CIS 


















































X 


IIS 


















































BIS 


















































£ 


m 




















































jw 


















































a 


a« 


















































■ 


JfS 


















































s 


UtS 




















































v« 


















































3 

H 


bflS 


















































80S 


















































10S 


















































u. 


»BS 




















































,f> 




















































Htt 




















































(« 




















































its 




















































IK 




















































m 
























































if 


s 

1*1 
oo 

SB 




A 

r- 
W 
>: 

SB 

Of- 

M 


3 
1 

- 
V 


**> 

a: 

P 


s 

1 




r-. 
fN 

H 

-c 

P 
SB 

if. 


s 

< 

SB 


r 


- 

c 
oo 

< 


-i 
■»- 

X 

p 
p 


j: 

< 

P 

M 


* 


< 


P 

— 










C 
■ 

V 




f- 

r— 
>^ 

s 
w 
P 

<x 




P 1 

□ 


I 




OO 

-r 

E 





I" nhiiitn Itie LiiIJii-ss fin jn> hue. jiid Ihc <iU'C"t« fttl llul Inn's N>» raw, Nn column, >nd pouUen in ba» 



controlling the switch will leave the swilch in the same stale it was in before ihe operation was 
performed. 



THE CASSETTE INTERFACE 

On the back edge of the Apple's mam board, on the right side next to the VIDEO connector, are 
two Small black packages labelled "IN" and "OUT" These are miniature phone jacks into which 
you can plug a cable which has a pair of miniature phono plugs on each end The othei end of 
Ihis cable can be connected to a standard cassette (ape recorder so that your Apple can save infor- 
mation on audio cassctie tape and read it back again. 

The connector marked OUT" is wired to yet another soli switch on the Apple board. This is 
another toggle switch, like the speaker switch (see above). The soft switch for the cassette out- 
put plug can be toggled hv referencing memory location number 49184 tor the equivalent -16352 
or hexadecimal SC020). Referencing ihis location will make the voltage on the OUT com 
swing from zero to 25 millivolts (one fortieth of a volt), or return from 25 millivolts back to 
zero. If the other end of the cable is plugged into the M1CROPHONI input of a cassette tape 
recorder which is recording onto a tape, tins will produce a tiny "click" on the recording. By- 
referencing the memory location associated with the cassette output soft swilch repealed!) and 
frequently, a program can produce a lone on ihc recording. H> varying the pilch and duration of 
this lone, information may lie encoded on a tape and saved for later use. Such a program to 
encode data on a 'ape is included in ihe System Monitor and is described on page 4(. 

Be forewarned that if you ailempi to flip the soft switch tor the cassette output by writing to its ^ 
special location, you will actually generate two --clicks" on the recording The reason for this is 

mentioned m the description of the speaker (above) You should only use "read" operations _^ 

when toggling the cassette output soft switch. J^* 

The other connector, marked "IN", can he used to "listen" to a cassette tape recording Its — 
main purpose is to provide a means of listening to tones on the tape, decoding ihem mlo data, 

and storing them in memory Thus, a program or data set which was stored on cassette tape may __ 

he read back in and used again. -^ 

The input circuit lakes a 1 volt (peak-io-peak) signal from the cassette recorder's EARPHONE — 

jack and converts il Into D String o( ones and zeroes Each lime the signal applied to the input — 

circuit swings from positive to negative, or vice-versa, the input circuit changes slate: if it was _ — 

sending ones, it will start sending zeroes, and vice versa. A program can inspect the stale ol the _■*• 
cassette inpul circuit by looking al memory location number 49248 or the equivalents -16288 or 

hexadecimal SC060. If the value which is read from this location is greater than or equal to 128. ^ 

then Ihe stale is a "one": if the value in ihe memory location is less than 128. then ihe Stale is a — 
"zero". Although BASIC programs can read the state of the cassette input circuit, the speed of a 

BASK program is usually much loo slow to be able lo make any sense out of what it reads. _*■ 
There is. however, a program in the System Monitor which will read the tones on a cassette tape 

and decode them I his is described on page 47. ^ 



22 



THE GAME I/O CONNECTOR 



The purpose of the Game I/O connector is to allow you lo connect special input and output dev- 
ices to heighten the effect of programs in general, and specifically, game programs. This connec- 
tor allows you to connect three one-bit inputs, four one-bit outputs, a data strobe, and four ana- 
log inputs to the Apple, all of which can be controlled by your programs. Supplied with your 
Apple is a pair of Game Controllers which are connected to cables which plug into the Game I/O 
connector. The two rotary dials on the Controllers are connected to two analog inputs on the 
Connector: the two pushbuttons are connected lo two of the onc-bu inputs. 




Phutn 7. The (iarne I/O Connector. 



ANNUNCIATOR OUTPUTS 



The four one-bit outputs ure called "annunciators". Hach annunciator output can be used as an 
input to some other electronic device, or the annunciator outputs can be connected to circuits to 
drive lamps, relays, speakers, etc. 

Hach annunciator is controlled by a soft switch. The addresses of the soft switches for the annun- 
ciators are arranged into four pairs, one pair for each annunciator. If you reference the Bttl 
address in a pair, you turn the output of its corresponding annunciator "off"; if you reference the 
second address in the pair, you turn the annunciator's output "on". When an annunciator is 



M 



"ofT*. ihe voltage on its pin on ihe Game I/O Connector is near volts; when an annunciator is 
"on", the voltage is near 5 volts. There are no inherent means to determine the current setting 
of an annunciator bit. The unnunciator soft switches are: 



Table 9: Annunciator 


Special Locations 


Ann. 


State 


Address; 
Decimal 


Ilex 





off 
on 


49240 
49241 


-16296 
-16295 


SC058 

SC059 


1 


off 

on 


49242 
49243 


-16294 
-16293 


SC05A 

SC05B 


2 


..li- 
on 


49244 

49245 


-16292 
-16291 


SC05C 

SC0M) 


3 


off 
on 


4924fc 
49247 


-16290 

■16289 


SC05E 
SC 051 



ONE-BIT INPUTS 



The ihree one-bit inputs can each be connected to either another electronic device or to a push- 
button. You can read the state of any of Ihe one-bit inputs from a machine language or BASIC 
program in the same manner as you read ihe Cassette Input, above. The locations for the three 
one-bit inputs have the addresses 49249 through 49251 (-16287 through -16285 or hexadecimal 
SC061 through SC063) 



ANALOG INPUTS 

The four analog inputs can be connected to 150K Ohm variable resistors or potentiometers. The 
variable resistance between each input and the +5 volt supply is used in a one-shot liming cir- 
cuit. As the resistance on an input varies, the liming characteristics of its corresponding liming 
circuit change accordingly. Machine language programs can sense the changes in the liming loops 
and obtain a numerical value corresponding lo the position of the potentiometer. 

Before a program can start to read ihe selling of a potentiometer, it must first reset ihe liming 
circuits. Location number 49264 (-16272 or hexadecimal SC070) does just this. When you reset 
the timing circuits, the values contained in ihe four locations 49252 through 49255 (-16284 
Ihrough -16281 or SC064 through SC067) become greater than 128 (iheir high bits are Bet), 
Within 3.060 milliseconds, the values contained in these four locations should drop below 128. 
The exact time it lakes for each location to drop in value is directly proportional to the selling of 
ihe game paddle associated with that location. If the potentiometers connected to the analog 
inputs have a greater resistance lhan I50K Ohms, or there are no potentiometers connected, then 
Ihe values in the game controller locations may never drop to zero. 



24 



STROBE OITPUT 



There is an additional output, culled C040 STROBE, which is normally +5 volts but will drop 10 
zero volts for a duration of one-half microsecond under the control of a machine language or 
BASIC program. You can trigger this "strobe" by referring lo location number 49216 (-16320 or 
SC04R Ik aware ihut if you perform a "write" operation lo this location, you will trigger the 
strobe Twke 'sec a description of this phenomenon in the section on the Speaker). 



Table 


11): Input/Output Special Locations 


Functions 


Address; 

Decimal 


Ilex 


Read/Write 


Speaker 


49200 


-16336 


SC030 


R 


Cassette Out 
Cassette In 


49184 

49256 


■16352 

-I62KX 


SC020 
SC060 


R 
R 


Annunciators" 


through 
49247 


-16296 

through 

-16289 


SC058 

through 

SC05F 


R/W 


1 lag inputs 


49249 
4925A 
49251 


-16287 

-16286 
-16285 


SC061 
SC062 
SC063 


R 
R 
R 


Analog Inputs 


49252 
49253 

49254 
49255 


-16284 
-16283 
-16282 
-16281 


SC064 

SC065 
SC066 

sctnr 


R 


Analog Clear 


49264 


-16272 


SC070 


R/tt 


Utility Strobe 


49216 


-16.120 


SC040 


R 



VARIETIES OF APPLES 



I here arc a lew variations on the basic Apple II computer. Some of the variations are revisions 
or modifications of the computer itself; others arc changes to its operating software. These are 
the basic variation- 



AUTOSTART ROM / MONITOR ROM 

All Apple II Plus Systems include the Autostart Monitor ROM. All other Apple systems do noi contain 
the Autostart ROM, hul instead have the Apple System Monitor ROM. This version ,.l die ROM 
lacks some of the features present in the Autostart ROM. bui also has some features which arc not 
present in thai ROM. The main differences in the two ROMs arc listed on the following pages. 



* Sec I hi: pi ;vnu» uhlc 



25 



Editing Controls The ESC- 1. J. k. awl M sequences, which move ihc cursor up, loft, right. 
and down, respectively, we noi available in the Old Monitor ROM. 

Stop-List. The Stop-List feature (invoked by a [CTRL SI >. which allows you to introduce a 
pause Into the output of most BASIC or machine language programs or listings, is not available 
in the Old Monitor ROM 



• The RESET cycle. When you first turn on your Apple or press [RESET ), the Old Monitor 
ROM will send you directly into the Apple System Monitor, instead of initialing a warm or 
Cold start as described in "The RESET Cycle" on page 36. 

The Old Monitor ROM does, however, support the STEP and TRACE debugging features of the 
System Monitor, described on page 51. The Autostart ROM does not recognize these Monitor 
commands. 



REVISION / REVISION 1 BOARD 

The Revision Apple II board lacks a few features found on the current Revision 1 version of 
the Apple II main board. To determine which version of the main board is in your Apple, open 
the ease and look at the upper right-hand corner of the board. Compare what you see to Photo 4 
on page 10. If your Apple does not have the single metal video connector pin between the four- 
pin video connector and the video adjustment potentiometer, then you have a Revision Apple. 

The differences between the Revision and Revision 1 Apples are summarized below. 

• Color killer. When the Apple's Video Display is in Text mode, the Revision Apple board ^ 
leaves the color burst signal active on the video output circuit. This causes text characters to 
appear tinted or with colored fringes. — 

• Power-on RESET. Revision Apple boards have no circuit to autom atically initiate a RESET ^ 
cycle *hen you turn the power on. Instead, you must press [RESET! once to start using your ^ 
Apple. 

Also, when you turn on the power to an Apple with a Revision board, the keyboard will ■? 
become active, as if you had typed a random character. When the Apple starts looking for 
input, it will accept thi s random charact er as if y ou had typed it. In order LO erase this charac- ^ 
ter. you should press ICTRL X| after you I RESET I your Apple when you turn on its power. 

• Colors in High-Resolution Graphics. Apples with Revision boards can generate only four £ 
colors in the High-Resolution Graphics mode: black, while, violet, and green. The high bit of 

each byte displayed on the Hi-Res screen (see page 19) is ignored. u- 

• 24k Meraor) Map problem. Systems with a Revision Apple II board which contain 20K or ^ 

24k bytes of RAM memory appear to BASIC to have more memory than they actually do. ff 
See "Memory Organisation", page 72, for a description of this problem. 

• 50 H/ Apples, The Revision Apple II board does not have the pads and jumpers which you — 
can cut and solder to convert the VIDEO OUT signal of your Apple to conform to the Euro- 
pean PAL/SECAM television standard. It also lacks the third VIDEO connector, the single «r 
metal pin in from of the four-pin video connector. 



26 



C 3 



Speaker and Cassette Interference. On Apples wiih Revision boards, any sound generated 
by the internal speaker will also appeur as a signal on ihe Cassette Interface's OUT connector. 
If you leave the tape recorder in RECORD mode, then any sound generated by the internal 
n^^MJ speaker will .ilso appear on the tape recording 



I 



kl 



Cassette Input. The input circuit for the C'assetle Interface has been modified so that it wi| 
respond wiih more accuracy lo a weaker input signal. 



- =H POWER SUPPLY CHANGES 



■itakjd In addition, some Apples have a version of the Apple Power SuppK which will accept only a 1 10 
~^ volt power 

the supply 



m 



■ volt power line input. Ihese arc are not equipped with the voltage selector switch on the back of 

I 

■ THE APPLE II PLUS 

The Apple II Plus is a standard Apple II computer with a Revision I board, an Autostart Moni- 
tor ROM, and the Applesoft II BASK language in ROM in lieu of Apple Integer BASIC. Euro- 
II pean models of the Apple II Plus are equipped with a 1 10/220 volt power supply. The Apple 

Integer BASIC ROMs, are not available on the Apple II Plus 




■"[ Mini-Assembler, the Floating-Point Package, and the SWEET-16 interpreter, stored in the 



S=5 



■ 

C 



i 



27 



s= 



ft? 
-J 



28 






CHAPTER i 

CONVERSATION WITH APPLES 



30 STANDARD OUTPU1 

30 TIIESTOP-1 .1ST FEATURE 

3! BUT SOFT. WHAT I Kill 1 tHROUGH YONDER WINDOW URi 

(OR. THE TEXT WINDOW) 

32 SEEING I! \l I IN HI \< K *ND WHITE 

32 STANDARD IM 

32 RDKEY 

33 GET I N 

34 E^ 

3h THE RESE1 CYCLE 

36 a I rOSTART ROM RESET 

37 AUTOSTART ROM SPEC I -M LO( ATIONS 

35 "OLD MONITOR" ROM RESET 




29 



Almost ever] program and language on the Apple needs some son of input from the keyboard, 
and some way lo print information on the screen. There is Q 5el of subroutines stored in the 
Apple's ROM memory which handle most of the standard input and outpui from all programs 
and languages on the Apple 

The subroutines in the Apple's ROM which perform these input and outpui functions are called 
by various names. These mimes were given lo the subroutines by their authors when they were 
written. The Apple Itself docs not recognize or remember the names of its own machine 
language subroutines, but if s convenient for us lo call these subrouiines by their given names. 



STANDARD OUTPUT 

The Standard output subroutine is called COL "I COLIT will display upper-case letters, numbers, 
and symbols on the screen in either Normal or Inverse mode ll will ignore control characters 
OXGOpt RETURN, the bell character, the line feed character. :wni the backspace character. 

The COUT subroutine mainlains its own invisible "output cursor"* (the position at which the 
nexl character is lo be placed) Each nmc ( (HI is called, it places one character on the screen 
at the current cursor position, replacing whatever character was there, and moves the cursor one 
space to the right If the cursor is humped off the right edge of the screen, then COUT shifts the 
cursor down lo the first position on the next line. If the cursor passes the bottom line of ihe 
screen, the screen "scrolls" up one line and the cursor is set to the tirsi posiiion on ihe newly 
blank bottom line. 

When a RETURN character is sent to COUT, il moves ihe cursor to the first position of the next 
line. If the cursor falls off the bottom of the screen, the screen scrolls as described above. 



THE STOP-LIST FEATURE 

When any program or language sends a RETURN code to COUT. COUT will take a quick peck at 
ihe keyboard. If you have typed a ICTRLS] since ihe last time COUT looked at the keyboard, 
then it will stop and wail for you to press another key. This is called the Stop-List feature " 
When you press another key. COUT will ihen output the RETURN cede and proceed with nor- 
mal outpui. T he code of the key which you press to end ihe Stop-List mode is ignored unless it 
,s a ICTRLCI . If ii is. ihen COUT passes this character code back lo the program or language 
which is sending output This .tllows you to terminate a BASIC program or listing by typing 
ICTRL CI while you are in Slop-List mode. 

A line feed character causes COU I lo move \\± mythical ouipul cursor down one line without any 
horizontal motion at all. As always, moving beyond ihe bottom of the screen causes the screen 
lo scroll and the cursor remains al its same position on a fresh bottom line. 

A backspace character moves the imaginary cursor one space lo the left. If ihe cursor is bumped 
off the lefi edge, il is reset lo ihe rightmost position on the previous line. If there is no previous 
line (if the cursor was al ihe lop of the screen!. Ihe screen does not scroll downwards, but instead 



' t ii.ni latin i'""a. "runner' 1 

" The Siop-Ksl feature is not piesertt or Apples wiihmii the Auinvurl ROM 



in 



ihe cursor is placed again al [he rightmost position on the top line of the screen. 

When COUT is seni a "bell" character (CTRL Gl, it does noi change ihc screen al all. but 
instead produces a tune from ihe speaker. The lone has a frequency of 100H/ and lasts for 
1 /10th of a second. The output cursor dues not move for a bell character. 



BUT SOFT, WHAT LIGHT THROUGH YONDER 
WINDOW BREAKS! 



(OR, THE TEXT WINDOW) 



In the above discussions of the various motions of the output cursor, the words "right", "left", 
"top", and "bottom" mean the physical right, left, top, and bottom of the standard 40-eharucter 
wide by 24-line tall screen. There is. however, a way to tell the COUT subroutine that you wnnl 
it to use only a section of the screen, and not the entire %0-eharacter display. This segregated 
section of the lext screen is called a "window". A program or language can set the positions »l 
the top, bottom, left side, und width of ihe lext window by storing ihose positions in four loca- 
tions in memory. When this is done, the COUT subroutine will use the new positions to calcu- 
late the size of ihe screen It will never print any text outside of ihis window, and when ii must 
scroll the screen, u will only scroll the text within ihe window. This gives programs the power to 
control the placement of text, and to protect areas of the screen from being overwritten with new 
texi. 

Location number 32 (hexadecimal S20) in memory holds ihe column position of ihe leftmost 
column in the window. This position is normally position lor the extreme left side of the 
screen. This number should never exceed 39 (hexadecimal $27), the leftmost column on the 
text screen Location number 33 (hexadecimal S21) holds the width, in columns, of the cursor 
window. This number is normally 40 (hexadecimal S28> for a full 40-charaeter screen. Be care- 
ful that the sum of the window width and the leftmost window position does not exceed 40! If it 
d^ics. it is possible for COUT to place characters in memory locations not on the screen, 
endangering your programs and data 

Location 34 (hexadecimal $22) contains the number of ihe lop line of the text window. This js 
also normally 0. indicating ihe topmost line of the Display, Location 35 (hexadecimal $231 holds 
the number of the bottom line of the screen (plus one), thus normally 24 (hexadecimal SIN* for 
the bottommost line of the screen. When you change the text window, you should take care that 
you know the whereabouts of the output cursor, and that ii will be inside the new window. 



Table 11: T 


rxt Window Special Locations 


Function: 


1 ocaiion: 

Decimal 


Ilex 


Minimum/Norm.il/Maximum Vjlu L 
Decimal Ilex 


Left Edge 


32 


$20 


0/0/39 S0/S0/S17 


Width 


33 


$21 
$22 


0/40/40 S0/S28/S28 


h>n Ldge 


34 


0/0/24 S0/S0/S18 


Bottom Edge 


35 


S23 


0/24/24 S0/S18/S18 



31 



SEEING IT ALL IN BLACK AND WHITE 

The COUT subrouiine has the power lo prim what's sent lo n in either Normal or Inverse text 
modes (see page 14) The particular form of its output is determined by the contents of location 
number 50 (hexadecimal S32). If this location contains the value 255 (hexadecimal SFF). then 
COUT will print characters in Normal mode: if the value is 63 (hexadecial S3F). then COUT will 
present its display in Inverse mode. Note that this mode change only affects the characters 
printed after the change has been made. Other values, when stored in location 50, do unusual 
things: the value 127 prints letters in Flashing mode, but all other characters in Inverse; any 
other value in location 50 will cause COUT lo ignore some or all of its normal character set. 



Table 12: Normal/Inverse Control Values 


Value: 
Decimal 


Effect; 

iL- 


255 


SFF 


COUT will display characters in Normal mode. 


63 


S3F 


COUT will display characters in inverse mode. 


127 


S7F 


COUT will display letters in Flashing mode, all 
other characters in Inverse mode. 



The Normal/Inverse "mask" location, as it is called, works by performing a logical "AND" 
between the bits contained in location 50 and the bits in each outgoing character code. Every bit 
in location 50 which is a logical "zero" will force the corresponding bit in the character code to 
become "zero" also, regardless of its former setting. Thus, when location 50 contains 63 (hexa- 
decimal S3F or binary 001 1 1 III), the lop two bits of every output character code will be turned 
"olT". This will place characters on the screen whose codes are all between and 63. As you 
can see from the ASCII Screen Character Code table (Table 7 on page 15), all of these characters 
are in Inverse mode. 



STANDARD INPUT 



There are actually two subroutines which are concerned with the gathering of standard input: 
RDKEY, which fetches a single keystroke from the keyboard, and GETLN, which accumulates a 
number of keystrokes into a chunk of information called an input line. 



RDKEY 



The primary function of the RDKEY subrouiine is lo wait for the user lo press a key on the key- 
board, and ihen report back lo the program which called it with the code for the key which was 
pressed. But while it does this. RDKEY also performs two other helpful tasks: 

I). Inpui Prompting. When RDKEY is activated, the first ihing il does is make visible the hid- 
den ouipul cursor. This accomplishes two things: il reminds the user that Ihe Apple is waiting 
for a key to be pressed, and it also associates the inpui il wants with a particular place on ihe 
screen. In mosi cases, the inpui prompt appears near a word or phrase describing what is being 
requested by Ihe particular program or language currently in use. The inpui cursor itself is a 
Bashing representation of whatever character was at the position of Ihe output cursor. Usually 
this is Ihe blank characler, so the input cursor most oflen appears to be a flashing square. 



32 



When the user presses a key, RDKEY dutifully removes the input cursor and returns the 
value of the key which was pressed to the program which requested it. Remember that the 
output cursor is just a position on the screen, but the input cursor is a (lashing character on the 
screen. They usually move in tandem and are rarely separated from each other, but when the 
input cursor disappears, the output cursor is still active. 

Random Number Seeding. While it waits for the user to press a key. RDKEY is continually 
adding I to a pair of numbers in memory. When a key is finally pressed, these two locations 
together represent a number from to 65,535. the exact value of which is quite unpredictable. 
Many programs and languages use this number as the base of a random number generator. 
The two locations which are randomized during RDKEY Bra numbers 78 and 79 (hexadecimal 
S4EandS4F) ( 



GETLN 

The vast majority of input to the Apple is gathered into chunks called lapul lines. The subroutine 
in the Apple's ROM called GETLN requests an inpul line from the keyboard, and af'er getting 
one, returns to the program which called it. GETLN has many features and nuances, and it is 
good to be familiar wilh the services it offers. 

When called, GETLN first prints a prompting chancier, or "prompt". The prompt helps you to 
identify which program has called GETLN requesting input. A prompt character of an asterisk 
(•) represents the System Monitor, a right carel (>) indicates Apple Integer BASIC, a right 
bracket <]> is the prompt for Applesoft II BASIC, and an exclamation point (!) is the hallmark of 
the Apple Mini-Assembler. In addition, the question-mark prompt (?) is used by many programs 
and languages to indicate that a user program is requesting input. From your (the user's) point 
of view, the Apple simply prints a prompt and displays an input cursor. As you type, the charac- 
ters you type are printed on the screen and the cursor moves accordingly. When you press 
!ki it k\ the entire ime is sew ofl to the program o] language you are talking to, aod you gel 
another prompt. 

Actually, what really happens is that after the prompt is printed, GETLN calls RDKEY, which 
displays an input cursor. When RDKEY returns with a keycode. GETLN stores that keycode in 
an input buffer and prints it on the scr een where the input cursor was. It then calls RDKEY again. 
This continues until the user presses [RETURN I . When GETLN receives a RETURN code from 
the keyboard, it sticks the RETURN code at the end of the input buffer, clears the remainder of 
the screen line the input cursor was on. and sends the RETURN code to COUT (see above). 
GETLN then returns to the program which called it. The program or language which requested 
input may now look at the entire line, all at once, as saved in the input buffer. 



At any time while you are typing a line, you can type a ICTRL X| and cancel that entire line. 
GETLN will simply forget everything you have typed, print a backslash (\), skip to a new line, 
and display another prompt, allowing you to retype the line. Also, GETLN can handle a max- 
imum of 255 characters in a line. If you exceed this limit, GETLN will cancel the entire line and 
you must start over. To warn you that you are upproaching the limit. GETLN will sound a tone 
every keypress starling wilh the 249th character. 

GETLN also allows you to edit and modify the line you are typing in order to correct simple 
typographical errors. A quick introduction to the standard editing functions and the use of the 
two arrow keys, Eland Q- appears on pages 28-29 and 53-55 of ihe Apple II BASIC Proprani- 
ming Manual, or on pages 27-28. 52-53 and Appendix C of The Applesoft Tutorial, at least one 



33 



of which you should have received, Here is a short description of GETLN'a editing Features; 

THE BACKSPACE (Q» KE\ 

Each press of ihe backspace key makes GE 1 1 N "forget" one previous character in the inpul line. 
It also sends a backspace character 10 COUT (see above), making the cursor move back to ihe 
character which was deleted. Al this point, a character typed on the keyboard will replace ihe 
deleted character both on the screen and in the input line. Multiple backspaces will delete succes- 
sive characters; however, if you backspace over more characters than you have t>ped. GETLN 
will forgei the entire line and issue another prompt. 

THE RETYPE (ED KE1 

Pressing the retype key has exactly the same effect as typing the character which is under the cur- 
sor. This is exirenily useful for re-entering the remainder of a line which you have backspaced 
over lo correct a typographical error. In coniunclion with pure cursor moves (which follow), it is 
also useful for recopying and editing data which is already on the screen. 



ESCAPE CODES 

When you press the key marked |ESCl on the keyboard, the Apple's inpul subroutines go into 
escape mode. In this mode, eleven keys have separate meanings, called "escape codes" When 
you press one of these eleven keys, the Apple will perform the function associated with that key 
After it has performed the function, the Apple will either continue or terminate escape mode, 
depending upon which escape code was performed. If you press any key in escape mode which is 
not an escape code, then that keypress will be ignored and escape mode will be terminated 

The Apple recognises eleven escape codes, eight of which are pure cursor mOves\ which simply 
move the cursor without altering the screen or the input line, and three of which arc screen ctear 
codes, which simply blank part or all of the screen All of the screen clear codes and the first four 
pure cursor moves (escape codes @. A. B, C. D. E. and Fl terminate the escape mode after 
operating. The final four escape codes (I, K. M. and J) complete their functions with escape 
mode active.' 



|ESC|[A~| A press of the [ESC I key followed by a press of the \\\ key will move the cursor one space 
to the right without changing the input line. This is useful for skipping over unwanted 
characters in an input line: simply backspace back over the unwanted characters, press 
1 ESC | [A*I to skip each offending symbol, and use the retype key in re-enter the remainder 
of the line, 



I ESC I [fl Pressing [ESC I followed by [b] moves the cursor back one space, also without disturbing 
the inpul line. This may be used lo enter something twice on the same line without 
reiyping it: just type it once, press [ESC] [H repeatedly to gel back to the beginning of Ihe 
phrase, and use the retype key to enter it again. 



• These lour escape aides are not IVliUblc on ApjMf wiihuut Ihe AUlOSUfl MoilttOI ROM 



34 



c 



\_.si < "I he kc\ M-gucntc £s< .< "'. moves the cursoi one line directl) down, with no horizontal 
movement IT the cursor reaches ihe bottom of the text window, then the cursot 
remains on the bottom line and ihe text in the window scrol ls up one line. The input 
line is not modified by the fESC"l [c] sequence. This, and I ESCl fp) (below), are useful for 
positioning the cursor at the beginning of another line on the screen, so that it may he 
re-entered with the retype key 

[ESC'I |l)l The I ESC I [Pi sequence moves the cursor directly up one line, again without an) horizon- 
tal movement. If the cursor reaches the top of the window, it stays there. The input 
line remains unmodified. This sequence is useful for moving the cursor to a previous 
line on the screen so that it may be re-entered with the retype key 



[ESCl [e] The (ESC] (E) sequence is called "clear to end of line" When COUT detects this 
sequence of keypresses, il clears the remainder of the screen line \n»t the input line!) 
from the cursor position to the righl edge ofthe text window. The cursor remains 
where il is. and the input line is unmodified. [Fscj |El always clears the rest of the line 10 
blank spaces, regardless of the selling of ihe Normal/Inverse mode location (see above). 



im i- fhis sequence is called 'clear to end of screen" [I does iusi that il clears everything in 
the window below or to the righl of the cursor. As before, the cursor docs nol move 
and Ihe input line is not modified. This is useful for erasing random garbage on a clut- 
tered screen alter a lot of cursor moves and editing. 



[ESCl I@] The |fsc| \@\ sequence is called "home and clear". Il clears the entire window and 
places Ihe cursor in ihe upper left-hand corner. The screen is cleared to blank spaces, 
regardless of the selling o f the Nor mal/ Inverse location, and the inpul line is not 
changed <nole thai "HE)" is lSHIFT PI ). 



| ESC I fkl These four escape codes are synonyms for the four pure cursor moves given above 
fE~sT| fJ]_When these four escape codes finish their respective functions, they do not turn off ihe 
lESClfMl escape mode: you can continue typing these escape codes and moving ihe cursor around 
lESCl ffl Ihe screen until you press any key other than another escape code. These four keys are 
placed in a "directional keypad" arrangement, so that the direction ol each key from ihe 
center y>\~ ihe keypad corresponds to ihe direclion which lhal escape code moves the cur- 
sor 



e a-*- 



♦ 



♦ 



Figure 4. Cursor-moving Escape Codes, 



J 5 



THE RESET CYCLE 



When you turn your Apple's power switch on* or press and release ihe IRESKTI key, Ihe Apple's 
6502 microprocessor initiates a RESET cycle. Il begins by jumping imo a subroutine in ihe 
Apple's Monilor ROM. In ihe iwo dilTercni versions of this ROM. ihe Monitor ROM and the 
Autostart ROM. the RESET cycle does very different things. 



AUTOSTART ROM RESET 

Apples with the Autostart ROM begin their RESET cycles by flipping the soft switches which 
control the video screen to display the full primary page of Text mode, with Low-Resolution 
Graphics mixed mode lurking behind the veil of text. Il ihen opens the text window to its full 
size, drops ihe output cursor to the bottom of the screen, and sets Normal video mode. Then it 
sets the COUT and KEYIN switches 10 use the Apple's internal keyboard and video display as Ihe 
standard input and ouipul devices. It flips annunciators and 1 ON and annunciators 2 and 3 
OFF on the Game I/O connector, clears the keyboard strobe, turns off* any active I/O Expansion 
ROM (see page 84), and sounds a "beep!". 



These actions are performed every lime you press and release ihe [RESET] key on your Apple, At 
ihis point, the Auiostan ROM peeks into iwo special locations in memory to see if it's been 
RESET before or if ihe Apple has just been powered up (those special locations are described 
below). If the Apple has just been turned on. then ihe Autosiart ROM performs a "cold start"; 
otherwise, il does a "warm start". 

1) Cold Start. On a freshly activated Apple, the RESET cycle continues by clearing ihe screen 
and displaying "APPLE II" top and center. Il then sets up ihe special locations in memory to 
tell itself that it's been powered up and RESET. Then it starts looking through the rightmosi 
seven slois in your Apple's backplane, looking for a Disk II Controller Card. It starts the 
search with Sloi 7 and continues down to Slot 1. If it finds a disk controller card, then il 
proceeds to bootstrap the Apple Disk Operaiing System OJOS) from ihe diskette in the disk 
drive attached to the controller card it discovered. You can find a description of the disk 
bootstrapping procedure in Do's and Don'ts of DOS, Apple part number A2L0O12, page II. 



If the Autostart ROM cannot lind a Disk II controller card, or you press IRES ET] again before 
the disk booting procedure has completed, then the RESET cycle will continue with a 
"lukewarm start". It will initialize -ind jump into the language which is installed in ROM on 
your Apple. For a Revision Apple, either without an Applesoft II Firmware card or wilh 
such a card wilh its controlling switch in the DOWN position, the Autostari ROM will start 
Apple Integer BASIC. For Apple Il-Plus systems, or Revision Apple Us wilh the Applesoft 
II Firmware card with the switch in the UP position, the Aulostart ROM will begin Applesoft 
II Floating-Point BASIC. 

2) Warm Start. If you have an Autostart R OM whic h has already performed a cold start cycle. 
then each time you press and release the IRESETI key. you will be returned to the language 
you were using, with your program and variables intact. 



' Power-on RESET .ules occur Dfllj Oil Revision I Apples 01 Revision C Apples wuh jl least one Dish II con- 
troller card. 



36 



~3 



AUTOSTART ROM SPECIAL LOCATIONS 

The three "special locations" used by the Autostart ROM all reside In an area of RAM memory 
reserved for such system functions, Following is a table of the special locations use' hv i 

AiUfiltjrl U(~\M- 



d by the 



Autostart ROM 





Tublc L 


: \ut..start ROM Special Locations 


Location: 
Decimal 


Hex 


Contents: 


1010 
1011 


S3F2 
S3F3 


Soft Entry Vector. These two locations contain 
ihe address of the reentry point for whatever 
language \> in use. Normally contains SF.003. 


1012 


S3F4 


Power-Up Byte. Normally contains S45. See 
below 


64367 
(-1169) 


Si U6I 


This is the beginning of a machine language 
subroutine which sets up the power-up location. 



S3 



When the Apple is powered up. the Autostart ROM places a special value in the power-up loca- 
tion. This value is the Exclusive-OR of the value contained in location 1 01 1 with the constant 
value 165. For example, if location 1011 contains 224 (its normal value), then the power-up 
value will be: 

Decimal Hex Binary 



Location 101 1 
Constant 



224 
165 



3E0 

SA5 



1 1 1 00000 

10100101 



69 



S45 01000101 



Power-t'p Value 

Your programs can change the soft entry vector, so that when you press I RESET I you will go to 
some program other than a language. If you change this soft entry vector, however, you should 
make sure thai you sei the value of the power-up byte to the Exclusive-OR of the high part of 
your new soil entry vector with the constant decim al 165 (h exadecimal SA5). If you do not set 
this power-up value, then the next time you press I RESET I the Autostart ROM will believe that 
the Apple has just been turned on and it will do another cold start. 

For example, you can change the soft entry vector to point to the Apple System Monitor, so that 
when you press [RESET I you will be placed into the Monitor. To make this change, you must 
place the address of the beginning of the Monitor into the two soft entry vector locations. The 
Monitor begins ai location SFF69, or decimal 65385. Put the last two hexadecimal digits of this 
address ($69) into location $31-2 and the lirst iwo digits (SFF) into location S3F3. If you are 
working in decimal, put 105 (which is the remainder of 65385/256) into location 1010 and the 
value 255 (which is the integer quotient of 65385/256) into location 1011. 

Now you must set up the power-up location. There is a machine-language subroutine in the 
Autostart ROM which wil automatically set the value of this location to the Exclusive-OR men- 
tioned above. Al you need to do is to execute a JSR (Jump to SubRoutine) instruction to the 
address SFB6F. If you arc working in BASIC, y ou should perform a CALL -1169. Now every- 
thing is set. and the next lime you press [RESET], you will enter the System Monitor. 

To make the I RESET I key work in its usual way. just restore the values in the soft entry vector to 
their former values (SE003. or decimal 57347) and again call the subroutine described above. 



23 



37 



Jfc- 
"OLD MONITOR" ROM RESET g; 

A RESET cycle in (he Apple II Monitor ROM begins by selling Normal video mode, u full screen 

or Primary Page lexi Wfth the Color Graphics mixed mode behind it. a (ully-opcned text window. 

and ihe Apple's standard keyboard and video screen as the standard input and output devices It — 

sounds a "beep!", the cursor leaps 10 tbe bottom line of the uncleared text screen, and you rind l^ - 

yourself lacing an asterisk <«t prompt and talking to the Apple System Monitor 






g 
E 



38 



* 



CHAPTER . 

THE SYSTEM MONI 




40 ENTERING Till MONITOR 

ADDRESSES VND DM \ 

-II I \ ^MINING 1 1 II ' ONTI '•!! Mum 

41 EXAMINU MORI MEMORY 

VMIN1NG Mil I MORI Ml MORY 

I H VNGING Mil I ONTI NTS OF V LO( Mi 

I HANGING mi CONTI NTSOI ( ONSI < i IIM I "< \TH ■ 

MOVING S HANG] "I MEMORY 
46 COMPARING TWO RANGES Ol MEMORi 
ih SAVING \ R \NGI 01 Ml MM'\ us l \PI 

RE MUM, \ K \NGI I ROM i 
48 CREATING \M> Rl NNING M \< HIM I \NGUAG] I R 
4" Mil mini \ssi MBI IK 
51 l'[ Hi 'GOING PRO< iRAMS 

: \ VMINIfs l , REGISTI RS 

54 MIm II i VNEOUS MONITOR I OMMANDS 

>PE< IAI IKK KS WITH Till MONITOR 

; Rl MIV, YOl R OWN (OMMANDS 
W SUMMARY 01 MONITOR COMMANDS 
61 SOMI I SI n I MONITOR SI BROl riNI 

rroR spe< i m Ma mi- 

66 MINI VSS1 MBI ER INSlKi CTION FORM Ms 



39 



Buried Jeep within the recesses of the Apple's ROM is a masterful program culled the System 
Monitor. Ii acU as both a supervisor of the system and a stave to tt; il controls all programs and 
all programs use It. You can use the powerful features of the System Monitor to discover the 
hidden secrets m all 65.536 memory locations. From the Monitor, you may look at one. some, 
or all locations; you may change the contents of any location; you can write programs in Machine 
and Assembly languages to he executed directly by the Apple's microprocessor >ou can save vasl 
quantities of data and programs onto cassette tape and read them back in again, you can move 
and compare thousands of bytes of memory with a single command, and you can leave the Moni- 
tor and enter any other program or language on the Apple. 



ENTERING THE MONITOR 

The Apple System Monitor program begins at location number SFF69 (decimal 65385 or —151) 
in memory. To enter the Monitor, you or your BASIC program can CALL this location. The 
Monitor's prompt (an asterisk |-]> will appear on the left edge of the screen, with a Hashing cur- 
sor to its right The Monitor accepts standard input lines (see page 3 21 just like any other system 
or language on the Apple. Ii will not lake any action until you press jRETlR.N j. Your input lines 
to the Monitor may be up to 255 characters in length. When you have finis hed your slay in the 
Monitor, you can return to the language you were previously using by typing '( TRI (. R_E 1 1 RN 
lor. with the Apple DOS. [J)[d1[J][g] [RETI'RN1 >, or simply presslR ESF.fi .' 



ADDRESSES AND DATA 

Talking to the Monitor is somewhat like talking to any other program or language on the Apple: 
you type a line on the keyboard, followed by a | RETURN I . and the Monitor will digest what you 
typed and ad according to those instructions. You will be giving the Monitor three types oj 
information addresses, values, and aimmumls. Addresses and values are given lo the Monitor in 
hexadecimal notation Hexadecimal notation uses the ten decimal digits (0-9) to represent them- 
selves and the first six letters (A-F) to represent the numbers 10 through 15. A single hexade- 
cimal digit can, therefore, have one of sixteen values from to 15. A pair of hex digits can 
assume any value from lo 255. and a group of four hex digits can denote any number from lo 
65.536. It so happens that any address in the Apple can be represented by four hex digits, and 
any value by Iwo hex digits. This is how you tell the Monitor about addresses and values. When 
the Monitor is looking for an address, it will take any group of hex digits. If there are fewer than 
four digits in the group, it will prepend leading zeroes; if there are more than four hex digits, the 
Monitor will truncate the group and use only the last four hex digits. It follows the same pro- 
cedure when looking for two-digit data values 

The Monitor recognizes 22 different command characters. Some of these are punctuation marks, 
others are upper-case letters or control characters. In the following sections, the full name of u 
command will appear in capital letters. The Monitor needs only the first letter of the command 
name. Some commands are invoked with control characters. You should note that although the 
Monitor recognizes and interprets these characters, a control character typed on an input line will 
nol appear on the screen 



Tim di>cs nut work on Apples wtlhoui ihc AllltMUn ROM 



4(» 



fc The Monitor remembers the addresses of up to five locations. Two of these .ire special. the) are 
^ the addresses of i he lasl location whose value vou inquired about, and the location which is next 
in have us value changed. These are called the last opened location and the WXI changeable loca- 
tion. The usefulness of these two addresses will he revealed shortly 



•9 

-5 



EXAMINING THE CONTENTS OF MEMORY 



3 

-^ When you type the address of a location in memory alone on an input line to the Monitor, it will 
3 reply* with the address v . .u typed, a dash, a space, and the value" contained in that location, 
thus: 

^ -E000 

~£ EM#- 20 

• 300 

— I3I«- yy 

Each time the Monitor displays the value contained in a location, il remembers that location as 
■^3 the last opened Inaiimn. For technical reasons, it also considers thai location as the next change- 
^ able bcattoa, 



3 EXAMINING SOME MORE MEMORY 

_2 If you lype a period (.) on an input line to the Monitor, followed by an address, the Monitor will 
display a memory dump, the values conlained in all locations from ihe last opened location to the 
"~i location whose address ynu lyped following the period. The Monitor then considers the lasl locu- 
tion displayed to be bolh the last opened location and the ne\t changeable location. 



" In the examples, poui queries ire in noimu) lype and ihe Apple replies in boldface 
*aflj M The vuluo printed tn these eumples rnaj differ from the values displayed hi youi &ppk foi the -.ime m- 

•a ructions. 



41 



-20 

00 20- HM 
- . 2B 

M21- 28 MM IS 0F IC 00 «• •# 

0028- AH 06 1)0 #7 

• 300 

300- 99 
-.315 

■3#1- B9 00 08 MA «A 0A 99 

0308- 00 08 C8 D0 F4 \6 2B A9 

03 10- 09 85 27 AD CC 03 

-.32A 



03 16- 


85 41 




3 18- 


84 40 


8A 4A 4A 4A 4A 09 


03 20- 


10 8 5 


3F A9 5D 85 3E 20 


0328- 


4 3 3 


20 



You should notice several things about the format of a memory dump. First, the first line tn the 
dump begins with the address of the location fofhwlng the last opened location; second, all other 
lines begin with addresses which end alternately in zeroes and eights; and third, there are never 
more than eight values displayed on a single line in a memory dump. When the Monitor does a 
memory dump, it starts by displaying the address and value of the location following the las) 
opened location. It then proceeds to the next successive location in memory If lhe address of 
that location ends in an 8 or a 0, the Monitor will "cut" to a new line and display lhe address of 
that location and continue displaying values. After it has displayed lhe value of the location 
*hose address you specified, it slops the memory dump and sets the address of both the last 
opened and the next changeable location to be the address of the last location in the dump. If 
the address specified on the input line is less than the address of the last opened location, the 
Monitor will displa) the address and value of only the location following the lust opened location. 

Vou can combine the two commands (opening and dumping! into one operation by concatenating 
the second to the first; that is. type the first address, followed by a period and the second address 
This two-addresscs-sflparated-by-a-period form is called a memory range, 

• 300 ill 

0300- 99 B9 00 08 0A 0A 0A 99 
0308- 00 08 C'8 D0 F4 A6 2B A9 



03 10- 09 


85 


27 


AD 


CC 


03 


85 


41 


03 18- 84 


40 


8A 


4A 


4 A 


4A 


4 A 


09 


0320- C0 


85 


3F 


A 9 


5D 


85 


3E 


20 


03 28- 43 


03 


20 


46 


03 


A5 


3D 


4D 


•30.40 
















03 0- AA 


00 


FF 


AA 


05 


(2 


05 


C2 


0038- IB 


FD 


D0 


3 


3C 


00 


40 


00 


0040- 3 
















• E0I5 L02 5 















42 



EH I 5- 41 ED FD 

EH 1 8- \9 2H CS 2 4 B*t H< A9 8D 

Ei2f- At* H7 2*1 ED EI) A9 



EXAMINING STILL MORE MEMORY 

A single press of ihe (RETTrn"] key will cause (he Monitor to respond wilh one line of u memory 
clump; thai is, a memory dump from the locution following ihe last opened location lo the nexi 
eight-location "cut". Once again, the last location displayed is considered the last opened and 
nest changeable location. 



tutus — tm 
■ IreturM 

«W WW 
•Kill H\ 

0*11*8— HH tltf »H t*K DO ttf Ml) 99 
•32 

M32- FF 

• ■kin hn 

AA M C2 05 C2 

• "HI M_R\j 

t»H38- IB FD DtJ t*3 3( UK 3F Kfl 



CHANGING THE CONTENTS OF A LOCATION 

You've heard all about the "next changeable location"; now you're going to use it Type .i 
colon followed by a value. 



MHHH- tttt 

• :SF 

^m Presto! The contents of the next changeable location have just been changed to the value you 
■^ typed. Check this by examining that location again 



=3 



HWHH- 5F 



« 



You can also combine opening and changing into one operation 
•362:4 2 
• 392 
H3H2- 42 



When you change the contents of a location, ihe old value which was contained m that location 

disappears, never to be seen again. The new value Will suck around until it is replaced by another 
hexadecimal value, 



CHANGING THE CONTENTS OF 
CONSECUTIVE LOCATIONS 

You i/oi/'i have to type an address, a colon, a value, and press [R ETURN] for each and ever) loca- 
tion you wish to change. The Monitor will allow you to change the values of up to eighty-five 
locations al a lime by typing only the initial address and colon, and then all the values separated 
h\ spaces. The Monitor will duly lile the consecutive values in consecutive locations, starling at 
the nexl changeable location. Alter it has processed the string of values, it will assume that the 
location following the last changed location is the next changeable location. Thus, you can con- 
tinue changing consecutive locations without breaking snide on the next inpui line by typing 
another colon and more values. 

• 309:69 01 20 ED II) 4C 3 
•300 

■ 3M- 6 9 

• HI M KN 

Ml Zf ED FD 4C «0 13 

-10 I 2 3 

• 4 5 6 7 

• 10 17 

HM1M- MM Ml H2 H3 (1-1 H5 W6 M7 



MOVING A RANGE OF MEMORY 

Vou can treat a range of memory (specified by two addresses separated by a period) as an entity 



= 



44 



^ unio itself and move il from one place lo another in memory by using [he Monitor's MO\ I 
^3 command In order lo move u range of memory from one plate la another, ihc Monitor musi be 

lold both where ihe range is situated in memory and whore ii is in be moved. You give ihis 
^| information to the Monitor In three parts; the address of (he destination of the range, the 
~ m address of the first location in the range proper, and the address of the last location m the range 
■^ You spedf) the starting and ending addresses of ihc range in ihe normal fashion. b> Separating 

■3 them with a period YOU Indicate that this range is to be placed somewhere else b> separating Ihe 

range and the destination address with a left caret l<). Finally, vou tell the Monitor thai >mi 

^| want to move the range t" the destination by typing the letter M. for "MOVE". The final com- 
—" mand looks like this 

_J (deslmalionl < [sturt] (end! M 



When you type ibis line lo the Monitor, of course, the words in curly brackets should he replaced 
by hexadecimal addresses and ihe Spaces should be omitted Mere are some real examples Of 
memorv mines 

-0 I 

HHHf- 51 «4 H 1*5 **7 00 00 HH 00 
000K- 00 00 00 00 00 Hit 00 **H 
■300 :A9 8D 20 ED FD A9 4s 20 DA FT) 4C 00 03 



•}1A1d.}<dC 



-2 

0300- A9 HD 20 ED FD A9 45 20 
_a 03*8- DA FD 4( 13 

■0<300 30CM 

i 0000- A9 8L> 20 ED FD A9 45 20 

0H0H- DA FD 4C 3 
— ■ 3 I 0<8 AM 

•310.312 

3 

03 10- DA FD 4( 

— , •2<7.9M 



0000- A9 8D 20 DA FD A9 45 20 
000K- DA FD 4C 00 3 



The Monitor simply makes a copy of the indicated range and moves il to ihe specified destina- 
tion. The original range is left undisturbed. The Monitor remembers the last location in the ori- 
ginal range as Ihc last opened location, and the lirsi location in the original range as the nexl 
changeable location. If ihe second address in the range specification is less than the first, then 
only one value (thul of the first location in the range) will be moved. 

If the destination address of the MOVE command is inside the original range, then strange and 
(sometimesl wonderful things happen: ihe locations between the beginning of ihe range and the 



4? 



re replicated throughout 



destination arc treated us a sub-range and the values in this sub-range are replicated ihtough 

the original range See 'Special I neks", page 55, for un interesting application of this feature. 



COMPARING TWO RANGES OF MEMORY 

You can use the Monitor to compare two ranges of memory using much the same formal aS you 
use to move a range of memory from one place to another In fact, the VERIFY command can 
be used immediately alter a MOVE 10 make sure thai the move was successful 

The VERIFY command, like the MOVE command, needs a range and a destination In short- 
hand: 

(destination! < (starO lend! Y 

The Monitor compares the range specified with the range beginning at the Uest.nation address II 
there is any discrepancy, the Monitor d.splays the address at which the diflerence was lound and 
the iwo offending values 

-«:D7 1-2 E9 1-4 F4 E5 II \fl £2 I" A« C3 C4 C5 

O00<«.EW 

..W<».DV 

-6.E4 

• 30«<0.DV 

»**ia*i-E4 <EE> 

Notice thai the VERIFY command, if it Hnds a discrepancy, displays the address of the location 
in the original ranee whose value differs from its counterpart in the destination range. II there is 
no discrepancy. VERIFY displavs nothing U leaves both ranges unchanged. The last opened and 
next changeable locations are SCI iusl as in the MOVE command. As before, rl the ending 
address of the range Is less than the starting address, the values of only the firs! locauons in the 
ranges will be compared. VERIFY also does unusual things if the destination is wilnm ihe origi- 
nal range; see "Special fucks", page 55. 



SAVING A RANGE OF MEMORY ON TAPE 

The Monitor has LWO special commands which allow you to save a range of memory onto cassette 
tape and recall it again for later use. The first of these two commands. WRITE, lets you save the 
contents of one to 65,536 memory locations on standard cassette tape 

To Save a range of memory to tape, give (he Monitor the starting and ending addresses of the 
range, followed by ihe letter W (for WRITE* 



40 



m 



(sum | (end | W 

To gel an accurate recording. you should put the Lape recorder in recor d mode be fore you press 
[RETl'RN.on the input line I 01 thfl i.ipe run j few seconds, then press | RETl'RN| . The Monitor 
will write a ten-second "leader" tone onto the tape, followed by Ihe data. When Ihe Monitor is 
finished, u will sound a '"beep!" and give you .inoiher prompt You .should then rewind the tape, 
and label the tape with something intelligible about Ihe memory range that's oil the tape and what 
its supposed io be. 

•0 II I 1 AD 30 C0 8 8 D0 4 to 0) K0 08 C 
A 1)0 16 A6 00 AC 02 00 ()0 

•0. 14 



0MWM- 


FF FF 


M> 30 <0 88 1)0 04 


0008- 


C6 Ml 


F0 08 (A 1)0 Id Aft 


0010- 


00 4< 


02 00 60 



I 4\V 



It takes dboui 35 seconds total to save the values of 4.096 memory locations preceded by the 
ten-second leader onto tape. This works nul to a speed of about 1,350 bits per second, average 
The WRITE command writes one extra value on the tape after il has written the values in the 
memory range. This extra value is the Checksum II is ihe partial sum of all values in the range. 
The READ subroutine uses this value i" determine il a Rl AD has been successful (see below' 



READING A RANGE FROM TAPE 

Once you*ve laved n memoo range onto tape with the Monitor's WRITL command, you can 
read thai memory range back into the Apple by using the Monitor's READ command I he data 
values which you've stored on the tape need not be read back into the same memor\ range from 
whence they e.ime; you can tell the Monitor to put those values intD any similarly sized memory 
range in the Apple's memory 

The format of the READ command is ihe same as that of the WRITE command, except that the 
command letter ts R. not W 



■ f Istartl (end] R 



Once again, after typing the command, don'l press fRF.Tl'RM . Instead, start the tape recorder in 
PLAY mode and wail for the tape's nonmagnetic leader to pass by. Although the WRITI com- 
mand put 1 ' a ten-second leader lone on the beginning of the tape, the READ command needs 
only three seconds of this leader in order to lock on to the frequency. So you should let a few 
seconds of tape go b> before you press IRETURM . Io allow the tape recorder's output to settle 
down to a steady tone. 

•0 000000000000000000 


•0 14 



47 



tftftftl- *H HH 00 00 »l* 00 UK HM 

000H- 00 00 KH WH HH 00 HI* 00 

0010- 00 00 00 00 00 
•0 MR 







0000- 


FF FF AD 3* C0 88 D0 04 


HHHK— 


(6 HI F0 H8 CA D0 F6 Ah 


0010- 


HH <C 02 HH 60 



After ihe Monitor has read in and stored all the values on the tape, ii reads in the extra check- 
sum value ll compares ihe checksum on ihe tape io lis own checksum, and if (he two differ, the 
Monitor beeps ihe speaker anil displays "IKK" This warns you thai ihere was a problem during 
the READ and thai the values stored in memory aren't ihe values which were recorded on the 
lape. If, however, ihe two cnecJcsums maich. ihe Monitor will give you another prompi 



CREATING AND RUNNING MACHINE 
LANGUAGE PROGRAMS 

Machine language is certainly the most efficient language on ihe Apple, allien ihe least pleas,mi in 
which to code. The Moniior has special facilities lor those of you who are determined to use 
machine language to Simplify creating, writing, and debugging machine language programs. 

Nnu can write a machine language program, take ihe hexadecimal values for Ihe opcodes and 
Operands, and store them in memory using ihe commands covered above. You can gel a hexade- 
cimal dump of your program, move ii around in memory, or save it to lape and recall n again 
simply by using ihe commands you've already learned. The mosl important command, however, 
when dealing with machine languuge programs is ihe GO command. When you open a location 
from ihe Moniior and type ihe letter G. ihe Monitor will cause the 6592 microprocessor io start 
executing ihe machine language program which begins at the last opened location. The Monitor 
treats this program as a subroutine: when it's finished, all it need do is execute an RTS (return 
from subroutine) instruction and control will be transferred back to ihe Moniior. 

Your machine language programs can call many subroutines in Ihe Moniior lo do various things. 
Here is an example ol loading and running a machine language program lo display ihe letters A 
through Z: 

8 69 1 C9 DB 1)0 F6 60 



18 69 HI 



(The instruction set of the Apple's 6502 microprocessor is listed in Appendix A ol" this manual.* 



•is 



■300 


A9 CI . 





tL> 


-L> 


-300 


MAC 










03 0- A9 
030 8- C9 
• 300G 

ahcdef<;h 


CI 

im 

JKI 


20 
DM 

Aft 


ED 

F6 

)PQ 


FD 

60 

RST 



= 



=a 



Now, straight hexadecimal code fen'I ihe easiest thing ir the world lo read or debug. Wuh this m 
mind, the creators of 'he Apple's Monitor neatly included b command to list machine language 
programs in assembi) language form. This means ih;it instead of having one, iwo, or three bytes 
of unformatted hexadecimal gibberish per instruction you now have a ihree-leuer mnemonic and 
some formatted hexadecimal gibberish to to in pre he nd for each Instruction, The LIST command 
lo the Monitor will start at the specified location and display a screenful! [20 lines* of Instruc- 
tions 



• 3001 

0300- K9 CI IDA #$CI 

0302- 2H ED FD JSR SFDED 

0305- 18 CLC 

0306- 69 HI ADC #S«I 

man- t'9 db imp #sdb 

030A- D0 F6 BNE S 0.1 2 

■ 03 0C- 6 a RTS 

010I>- a a KRk 

03 0E- 00 KRK 

030F- HI* KRK 

0310- HI* KRK 

m 03ii- 00 KRK 

«3 12- KRK 

-3 0313- Ha KRK 

0314- HH KRK 

0315- KRK 

0316- a a krk 

0317- a a KRK 

0318- at* KRK 

0319- HH KRK 



Recognize those first rev. lines? They're the assembly language form of the program you typed 
in a page 01 SO ago. I he rest of the lines (the KRK instructions) are just there lo till up the 
screen. The address thai you specif) is remembered by the Monitor, but not in one of the ways 
explained before. It's put in the Program Counter, which is used solely lo point to locations 
within program-*. Alter a LIST command, the Program Counter is set to point to the location 
immediately following the last location displayed on the screen, so that if you do another LIST 
command it will continue wuh another screen full of instructions, starting where the first screen 
left off. 



THE MINI-ASSEMBLER 

There is another program within the Monitor' which allows you lo type programs into the Apple 
in the same assembly formal which the 1ISI command displays. This program is called ihe 
Apple Mini-Assembler. It is a '*mini"-assemhler because it cannot understand symbolic labels, 
something ihat a full-blown assembler must dt» lo run the Mini-Assembler, type: 



* The Mlni-Auembtci iloc* not .hiujIIi reside "i the Monitor K< >\| hui is |uri iif i he Intetti'i H\SH Ki >\l 
■ei. Thus, n is not flvvlliblc on \ppt* " Plu* systems or while FirmwurB Applesoft II is In use 



A<) 



-I 666G 

I 

YOU arc now in the Mini- Assembler The exclamation poinl If) is the prompt character. During 
your Slaj in the Mini- Assembler, you can execute any Monitor command by preceding u with 1 

dollar sign (S) Aside from thai, the Mini-Assembler has an instruction set ami synuv all us 
own 

The Mini-Assembler remembers one address, thai of the Program C ounter Before you start to 
enter a program, you musl sel the Program Counter to point to the location where you want your 
program lo go. Do (his by typing ihc address followed by a colon. Follow this with the 
mnemonic tor the first instruction in yOUl program, followed by a space. Now type the o perand 
of the instruction (Formuut lor operands are listed on page 661. Now press IRETV RN] The 
Mim-Assembler converts the line you typed into hexadecimal, stores it in memory beginning at 
the location of the Program Counter, and then disassembles it again and displays the disassem- 
bled line on top of your input line, li then poses another prompt on the next line No* It S 
ready 10 accept the second instruction in your program. To tell it that you want the next instruc- 
tion to follow the first, don't type an address or a colon but only a ^w^c, followed by the next 
instruction's mnemonic and operand Pres- RETURN I . It assembles that line and waits for 
another 

If the line you type has an error in it. the Mini- Assembler will beep loudly and display a 
circumflex (") under or near the offending character in the input line Most common em 
the result ol typographical mistakes; misspelled mnemonics, missing parentheses, etc. The 
Mmi-ASSCmblci also will reject the input line iT you forget the space before or after a mnemonic 
Or include an extraneous eharacter in a hexadecimal value or address II the destination address 
Of a branch instruction is out of the range of the branch (more than 127 locations distant from 
(dress of the instruction!, the Mini-Assembler will also (lag this ,is an error 

!300 LDX #02 

H.'KH- A2 02 I l>\ PSH2 

! I DA Sfl.X 

0302- B5 00 l.DA S00.X 

• STA SI 0.X 

30-1- 9 5 I** STA SI H.X 

! DEX 

030ft- CA DEX 

! STA SC0 3 

0307- 8D 30 C0 STA 5(0*0 

! HPL S302 

030A- 10 Fft BPL $0302 

! BRK 

03 0C- BRk 

! 

lo exit the Mini-Assembler mm\ re-enter the Monitor, either press RKsKTJ or type the Monitor 



SO 



command (preceded by a dollar sign t FF69G 
[SFF69G 



1 


Your assembly language program 


is stored in 


memory. 




command: 










2 


• 3001 










- 


0300- 


A2 


02 


LDX 


#S02 




0302- 


B5 


HH 


Ml A 


$00. X 


= 


0304- 


95 


10 


SI \ 


S10.X 


030*- 


CA 




DEX 






0307- 


HI) 


30 ( 


STA 


SI 030 


i 


030 A- 


10 


F6 


BPI. 


S0 30 2 




030C- 


00 




BRK 




= 


030D- 


00 




BRK 




030E- 


00 




RRK 






3 F- 


00 




BRK 




3 


0310- 


00 




BRK 






0311- 


00 




BRK 




2 


0312- 


00 




BRK 




0313- 


00 




BRK 






0314- 


00 




BRK 




2 


3 1 5- 


00 




BRK 






0316- 


00 




BRK 




a 


0317- 


00 




BRK 






0318- 


00 




BRK 






0319- 


00 




BRK 





You can look ai n again with the LIST 



DEBUGGING PROGRAMS 

As pui so concisely b> Lubarsky', "There's always one more bug." Don'i worry, ibe Monitor 
provides facilities lor slopping through ornery programs to find that one last bug. The Monitor's 
STEP" command decodes, displays, and executes one instruction at u time, and the TRA< I " 
command steps quickly through a program, stopping when a BRK instruction is executed. 

Each SUP command causes ihe Monitor lo execute the Instruction in memory pointed 10 by the 
Program Counter. The instruction is displayed in us disassembled form, then executed. The 
content!* of the 6502's internal registers ,trc displayed after the instruction is executed. After exe- 
cution, the Program Counter is bumped up to poini lo the next instruction in the program. 

Here's what happens when you STHP through ihe program you entered using the Mini- 
Assembler, above: 



1 In \furptj) \ / .),. amtOthpi ftftmm why Thinip Ga lfn>/», Mflied b> Arthur Hiixh Pricc/Slcm/Sloanc 1977 

! II' .unl IN.M I n>mm.tnds are nni jijiUhle on apples wild ilu- \UIOSlirt ROM 



51 



• 3B0S 

0300- A2 «2 ll)X #S«2 

A=MA X=H2 V=I)8 P-30 S-F8 



er 



(302- B5 t»« l.DA S*»M.\ £» 

A-0C X=H2 Y«I)H P=3 S=FK 

• s — 

0304- 9 5 It) STA Slfl.X _ 

A— 0C \=H2 Y=D8 P=30 S»FB **. 

■ I 2 

!*•• I 2— 0C *± 

•S _ 

S 

«3«6- CA Dl \ 

A=0C X=tH Y=D8 P=3H S=F8 — 

-S fc 

0307- 80 31 C« STA SC030 um 

A-0C X=tll V=D8 P=3« S-F8 

• S — 

• 3HA- 10 F6 BPI. S«3H2 

A-0C X=HI V=D8 P=30 S-F8 *. 
•S 

0302- B5 HH LDA SHH.X ^" 

A=HB X=ttl Y =1>H P=3« S=F8 

• S £ 

0304- 95 ih STA Sl**.\ — 

A=HB \=MI \=1)H P=3»» S=F8 ■* 



Notice ihiii after ihe ihird instruction was executed, we examined the contents of location 12 
Thcj were as we expected, and so we continued stepping. The Moniior keeps the Program 
Counier and ihe last opened address separate from one (mother, so thai you can examine or 
change ihe contents of memory while you are stepping through your program. 

The TRACE command is tu si an inli nite STEPper. Il will stop TRACE! ng the execution of a pro- 
gram only when you push RESET] or il encounters a BRK instruction in ihe program. If the 
TRACE encounters the end of a program which returns lo ihe Monitor via an RTS instruction, 
ihe TRACEing will run off into never-never land and must he slopped with ihe 1 RESET I huilon. 

•T 

M3H6- CA DEX 

A=0B X=HH Y=D8 P=3 2 S=F8 



H3H7- HI) 3H ( H STA SC03H 


s 


A=0B X=HH Y=I)8 P=32 S=F8 




M3HA- IH F6 BPI. St*3H2 






fr 


52 


■ 



A=0B \=HH Y=I>8 P—32 S=F8 
0302- BS 00 IDA $00, X 

A=0A X=00 V=D8 P-31 S=FN 
3 0-1- l >5 10 STA S10.X 

A=0A X=00 \=L>K P=30 S=F8 
3»6- (.A DEX 

\=H\ \=IF \=m P=B0 S=FK 
0307- KI) 31 Ci STA SC030 

\=0A \=FF Y=DK P=B0 S=FK 
»3»A- It* F6 BPL SH3I2 

A=0A \=FF V=DK P=B0 S=FK 
I3«C- BRK 

3 0(- A=0A \=FF \=DH P=B0 S=FH 



EXAMINING AND CHANGING REGISTERS 

As you saw above, the SI IV and TRACE commands displayed Ihe contents of ihc 6502's inter- 
nal registers .tiler each instruction. You can examine these registers at will or pre-sei them when 
you TRACE, STEP. 01 CiO a machine language program 

The Monitor reserves five locations in memory for the live 6502 registers: A, X, Y. P (processor 
Status re gister), and S (slack pointer). The Monitor's EXAMINE command, invoked by a 
( [ri. i. . tells ihe Monitor 10 display it' 1 -' contents oi these locations on Ihe screen, and lets the 
location which holds the 6502's A-rcgtstcr be the next changeable location. If you wanl to 
change the values in these locations, just type a colon and the values separated by spaces. Next 
lime you give (he Monitor a (i<). STEP, or TRACE command, ihe Monitor will load these five 
locations into their proper registers inside the 6582 before n executes the first instruction in your 
program 

■ !<TR I F.I 

A=HA X=FF Y-D8 P=B0 S-F« 

- B» 02 



• < fRI I 



A=B0 \=0 2 Y=DK P=B0 S-FB 

-306S 

03 06- CA HEX 

A=BH X=HI Y=D« P-31 S-F8 
•S 



0307- Hll 3*» (0 SI A SC030 

A=B0 X=0l Y=I)H P=3 S=l N 
•S 



030A- 10 F6 BPL S0302 

A-B0 X=0l Y=D8 P=30 S-F8 



53 



fr- 



M1SCELLANE0US MONITOR COMMANDS 



(see 



.F 



««l>i»— 


|A till Hi Hli HE HK l)H 144 


HHHK- 
•1 


C6 HI FH H8 CA DH Fft Aft 



MHHH- 


HA HB HC HD HE HF OH H4 


HHH8- 


C6 HI FH HK CA OH F6 A6 


»N 





I 



HHHH- HA HU Hi HI) HK HF DH H4 
HHH8- (6 HI FH HK CA DH F6 Aft 



The BASIC Command, Invoked by a ICTRL B| . leis you leave Ihe Monitor and enter the language 
installed In ROM on your Apple, usualU cither Apple Inieger or Applesoft II BASIC. Any pro- 
gram or Variables thai you had previously in BASIC will he lost, If you've left BASIC for the 
Monitor and you want to re-enter BASIC with your program and variables intact, use the 
ICTRL Cl (CONTINUE BASIC* command. II you have the Apple Disk Operating System (DOS) 
active, the '3 DBG' command will return you to the language you were using, with your program 
and variables inijci 



The PRINTER command, activated by a ICTRI. P| . diverts all output normally destined for the 
screen to an Apple Intelligent Interface* in a given slot in the Apple's backplane. The slot 
number should be from I to 7. and there should be an interlace card in the given slot, or you will 
lose control of your Apple and your program and variables may be lost. The format for the com- 
mand is: 



Islol numberl [CTRL p| 

A PRINTER command to slot number H will reset the How of printed output back to the Apple's 
video screen. 

The KEYBOARD command similarly substitutes the device in a given backplane slot for the 
Apple's keyboard For details on how these commands and their BASIC counterparts PR# and 
IN# work, please refer to "CSW and KSW Switches 1- , page 83. The formal for the KEYBOARD 

command is 



(slot numberl |CTR I K| 



P- 



You can control the setting of the Inverse/Normal location used by the COUT subroutine (s. . 
page -12) from the Monitor so that all of the Monitor's output will be in Inverse video. The 
INVERSE command does this nicely. Input lines arc still displayed in Normal mode, however. mm 
1*0 return Ihe Monitor's output 10 Normal mode, use the NORMAL command. i" 1 



54 



A slot number of for ihe KEYBOARD command will force ihc Monitor 10 listen for input from 
S ihc Apple's built-in keyboard. 



5 



The Monilor will also perform simple hexadecimal addition and subtraction. Just type a line in 
l he formal: 

{value} + [value] 

{value) ~ (value) 

The Apple will perform the arithmetic and display the result: 

ij .20+13 

=3 3 

•4A-C 
=3E 
• FF+4 

•3-4 
=FF 



"= 
s 



= 



SPECIAL TRICKS WITH THE MONITOR 



You can put as many Monilor commands on a single line as you like, as long as you separate 
^g them with spaces and the total number of characters in ihe line is less than 254. You can inter- 
• mix any and all commands freely, except the STORE (:) command. Since the Monitor takes all 
,, values following a colon and places ihem in consecutive memory locations, the lasi value in a 
•£ STORE must be followed by a letter command before another address is encountered. The 

NORMAL command makes a good separator; it usually has no effect and can be used anywhere. 



-300.307 300 18 69 I N 300.302 300S S 

•300- 00 00 00 00 00 00 00 00 

0300- 18 69 01 

3 0- 18 CLC 

\=0 4 X=01 Y=U8 P*=3 S*F8 

0301- 69 01 ADC #S0l 
\=05 \=01 Y=D8 P=3 S=F8 



Single-letter commands such as L. S. I. and N need not be separated by spaces. 

If the Monitor encounters | character in the input line which it does not recogni/e as either a 
hexadecimal digit or a valid command character, it will execute all commands on the input line up 

^m» lo that character, and then grind to a halt with a noisy beep, ignoring the remainder of the input 

-H line. 

"3 The MOVE command can be used to replicate a pattern of values throughout a range in memory. 



5> 



It- 

To dn this, first store the pattern in ns first position in ihe range: J 

ftr 
•.100.11 2 2 33 

Remember the number ol values in the putlern: in this case, 3. Then use this special arrange- a*. 
mem ol [he MOVE command; 



Islurl + numher} < (stun) (end — number) M 



Ift- 



•3 03<3 00.3 2DM 
-3 00 32F 



#3 0- 


II 2 2 3 3 II 2 2 33 II 2 2 


0308- 


33 11 22 33 II 22 33 11 


03 10- 


22 33 11 22 33 11 22 33 



I hi> MOVE command will first replicate the pattern al ihe locations immediate!) following the w- 
original pattern, then re-replicate thai pattern following itself, and SO on until it fills the entire 
range — 

Eft 

03 18- 1 I 22 33 II 22 33 II 22 

0320- 33 II 22 33 II 22 33 II — 

0328- 22 33 II 22 33 II 22 33 ft? 

• 

A similar trick can be done with the VKRIFY eommund to check whether a pattern repeats nselt 
through memory, This is especially useful to verlf) thai -i given range of memory locations all — 

contain the same value. 

•3 00.0 jfe 

•30K3 00.3IFM — 

•30K300.3IFV 

E 

•304 :02 

• 30K300.3IKV ^ 

0303-00 (02) Bh 

304-0 2 100) ^ 



You can create a command line which will repeat all or part of itself indefinitely by beginning the 
part of ihe command line which is lo be repealed with a letter command, such .is N. and ending it 
with the sequence 34 n, where n is a hexadecimal number specifying Ihe character position of the 
command which begins the loop; for the first character in the line, n=0. The value for n musl 
be followed with a space in order for ihe loop lo work properly. 

•N 300 302 34:0 

300- II 



M, 






3 2- 


3 3 


300- 


1 1 


1312- 


33 


0300- 


II 


•*3H2— 


33 


03 00- 


1 1 


**3M2- 


3 3 


3 0- 


1 1 


030 2- 


33 


03 00- 


1 1 


3 2- 


3 3 


»< ;n 





a 



The only way lo stop a loop like this i> to press I RESET I . 



^ CREATING YOUR OWN COMMANDS 

"H The USER ( ICTRL V I > command, when encountered in [he input line, forces (he Monilor to 
jump lo location number S3 1 8 in memory You can pul your own JMP Instruction in ihis loca- 
ls lion which will jump to your own program Your program can then either examine Ihc Monitor s 
registers and pointers or the input line itself. For example, here is u program which will make 
the [CTRL Vl command act as a "comment" indicator: everything on the input line following 
■3 the lCTRI. V~| will be displayed and ignored. 

m> -F6 66G 

13107 LDV S34 

1300- \4 34 LDY $34 

I LDA 200. Y 

1312- B9 00 02 LDA $0200, Y 
! JSR FDED 

1315- 20 EI) Fl) JSR SFDED 

! I NY 



-H 


W.1HK— (X 

! (MP ffSSI) 




1 N> 




*i 


1319- ( •» «D 




IMP 


#581) 


m+ 


! BNE 302 
030B- 1)0 FS 




BNE 


S0302 


~ 


! JMP SFFo9 










I30D- 4< 69 


KF 


JMP 


SFF69 


m 


13F8:JMP S300 








^ 


■3F8- 4C 00 


03 


JMP 


$0300 



I 



57 



If 

"SFF69G t2 

. ( IKI \ tills IS \ I! M I 

lllis IS \ IKVI 



fcr 



>s 



.- SUMMARY OF MONITOR COMMANDS 



Suniman of Monitor Commands. 



a 
= 
a 



Examining Memory, 

(adrs) 

[adrsl],|odrs2j 



KKI'I'KN 



Changing i he Contents of Memory. 
|adrs|:|val| |vqI| ... 

:{val) (val| ... 

Moving and Comparing, 
(dcsil < (slurl). (cnd}M 

|desO<|sian|.|end|V 

Saving and loading via Tape. 

fstart|.|end|W 

|siuri).(end)R 

Running and Listing Programs. 
(udrsjO 

ladrs! I. 



Examines the value contained in one location. 

Displays Ihe values contained in all locations 
between (adrsll and |adrs2| 

Displays the values in up to eight locations fol- 
lowing the last opened location. 



Stores the values in consecutive memory loca- 
tions starting at (adrs). 

Stores values in memory starling ai the next 
changeable location. 



Copies the values in the range |siari|.(end| into 
the range beginning at |dest|. 

Compares the values in the range {siart|.{endl 
in ihose in the range beginning at |desl|. 



Writes the values in ihe memory range 
jstart|.|end| onto tape, preceded by a ten- 
second leader 

Reads values from tape, storing them in 
memory beginning at jslarl) and slopping al 
lend). Prints "FRR"' if an error occurs. 



Transfers control lo the machine language pro- 
gram beginning at (adrs). 

Disassembles and displays 20 instructions, Start- 
ing at {adrs|. Subsequent L's will display 20 
more instructions each 



59 



Summary of Monitor Commands. 



The Mini-Assembler 

I 666G 
Slcommand) 

SFF69G 
ladrs] S 

(adrs) T 
ItTRI, K| 

Miscellaneous. 

I 
N 



( IKI R 
ICTRL CI 

|vflll+(val| 

(villi -(vail 



(sin:) ItTRI 


1' 




(slot) ICTRL 


h 






( IKI Y| 









Invoke the Mini-Assembler." 

Execute a Monitor command from the Mini- 
Assembler. 

Leave the Mini-Assembler. 

Disassemble, display, and execute the instruc- 
tion at ladrs), and display the contents of the 
6502's internal registers. Subsequent S*S wfll 
display and execute successive instructions." 

Step infinitely. The TRACE command stops 
only when it executes a BRK instruction or 
when you press IRES ED ." 

Display the contents of the 6502"s registers. 



Set Inverse display mode. 

Set Normal display mode. 

Enter the language currently installed in the 
Apple's ROM. 

Reenter the language currently installed in the 
Apple's ROM. 

Add the two values and print the result. 

Subtract the second value from the first and 
print the result. 

Divert output to the device whose interface 
card is in slot number (slot). If (slol| = 0. then 
route output to the Apple's screen. 

Accept input from the device whose interface 
card is in slot number (slot}. If (slol) = 0. then 
accept input from the Apple's keyboard. 

Jump to the machine language subroutine at 
location S3F8. 



Mnl jvuibblc in Ihc Apple II Plus 

v : i illflbk In the \wosutrt Ki>M 



60 



= SOME USEFUL MONITOR SUBROUTINES 

■^J Here ts a list of some useful subroutines in the Apple's Monitor and Autostart ROMs, To use 
ihese subroutines from machine language programs, load Ihe proper memory locations or 6502 
^^ registers as required by Ihe subroutine and execute a JSR to the subroutine's starling address. It 
— — will perform the function and return with the 6502's registers set as described. 



■*■■ SFDED COLT Output .1 character 



s 
^ 



= 



— : 



COUT is the standard character output subroutine. The character to be output should be in the 
accumulator. COUT calls the current character output subroutine whose address is stored in 
CSW (locations $36 and S37). usually COUT1 (see below). 



SI hit* COUTI Oulpul to screen 

COUT1 displays ihe character in the accumulator on the Apple's screen at the current output cur- 
sor position and advances the output cursor. It places the character using (he setting of the 
Normal/Inverse location. It handles the control characters RETURN, linefeed, and bell. It 
returns with all registers intact. 



■S SFE8U 



SITINV Set Inverse mode 



jij Sets Inverse video mode for COUTI All output characters will be displayed as black dots on a 
white background. The Y register is set to S3F. all others are unchanged. 

■£J SFE84 SETNORM Sel Normal mode 

mi Sets Normal video mode for COUTI- All outpui characters wwill be displayed as white dots on a 
black background The Y register is set to SFF, all others are unchanged. 

-fi SFD8E CROUT Generate a RETURN 

M CROUT sends a RETURN character to the current output device. 

SFD8B CROl'Tl RETURN «ith clear 



CROUTI clears the screen from the current cursor position to the edge of the text window, then 
calls CROUT. 



mm SFDDA PRBYTE Print a hexadecimal bvte 

This subroutine outputs the contents of ihe accumulator in hexadecimal on the current oulput 
device. The contents of ihe accumulator are scrambled, 



SFDE3 PRIIEX Print a hexadecimal diuii 

This subroutine outputs the lower nybble of the accumulator as a single hexadecimal digit. The 
contents of the accumulator are scrambled. 

SF941 PRNTAX Print A and \ in hexadecimal 

This outputs the contents of the A and X reisters as a four-digit hexadecimal value. The accu- 
mulator contains the first byte output, the X register contains the second. The contents of ihe 



M 



accumulator arc usually scrambled 

SF948 PRBLNK Prinl 3 spaces 

Oulpuls three blank -spaces to ihe standard oulpul device. Upon exit, the accumulator usually 
contains SAW, the X register contains 0. 

SF94A PKBL2 Print many blank spaces 

This subroutine outputs from I to 256 blanks to the standard output device. Upon entry, the X 
register should contain the number of blanks to be output. If X = S00, then PRBL2 will output 
256 blanks. 

SFF3A BELL Output a "bell" character 

This subroutine sends a bell (CTRL G) character to the current output device. It leaves the 
accumulator holding S87. 

SFBDI) BKLLI Beep Ihe Apple's speaker 

This subroutine beeps the Apple's speaker for .1 second at I KHz. It scrambles the A and X 

registers. 

Ml)*" RDKKY Gel an input character 

This is the standard character input subroutine. It places a flashing input cursor on the screen at 
the position of the output cursor and jumps to the current input subroutine whose address is 
stored in KSW (locations S3S und S39). usually KEYIN (see below). 

SFI)35 RIK "IIAR Get an input character or ESC code 

RDCHAR is an alternate input subroutine which gels characters from the standard input, but also 
interprets the eleven escape codes (see page 34). 

SFD1B KEYIN Read the Apple's keyboard 

This is the keyboard input subroutine. It reads the Apple's keyboard, waits for a keypress, and 
randomizes the random number seed (see page 32). When it gets a keypress, it removes the 
flashing cursor and returns with the keycode in the accumulator. 

SF06A GETLN Gel an input line with prompt 

GETLN is the subroutine which gathers input lines (see page 33). Your programs can call 
(il 1 1 N with the proper prompt character in location S33: til ■ I I N *ill return with the input fine 
in Ihe input buffer (beginning at location S200> and the X register holding the length of the input 
line. 

SFD67 GETLNZ Get an input line 

GETLNZ is an alternate entry point for GETLN which issues a carriage return to the standard 
output before falling into GETLN (see above). 



62 



SFD6F 



CETLN1 



Get an input line, no prompt 



GHTLNl is an alternate entry point Tor GETI.N which docs not issue a prompt before it gathers 
the input line. If. however, the user cancels the input line, either with loo many backspaces or 
with a ICTRL XI , then GETLN1 will issue the contents of location $33 as a prompt when it gets 
another line. 



SFCA8 



WAIT 



I). Ln 



This subroutine delays for a specific amount of time, then returns lo the program w 
The amount of delay is specified by the contents of the accumulator. With A the c< 



which called it. 

.iiicu ity uic tumciiin ui me ovkuiiiwuuui- ««u n umj COnteniS Ol the 

accumulator, the delay is V:(26 + 27A + 5A 2 ) ^seconds. WAIT returns with the A register zeroed 
and the X and Y registers undisturbed 



SIM.4 



SETCOL Set Low-Res Graphics color 



This subroutine sets the color used for plotting on the Low-Res screen to the color passed in the 
accumulator. See page 17 for a table of Low-Res colors. 

SF85F NEXTCOL Increment color by 3 

This adds 3 to the current color used for Low-Res Graphics 

SF8H PLOT Plot a block on the Low-Res screen 

This subroutine plots a single block on the Low-Res screen of the prespecified color. The block's 
vertical position is passed in the accumulator, its horizontal position in the Y register. PLOT 
returns with the accumulator scrambled, but X and Y unmolested. 



SF819 



HUNK 



Draw a horizontal line of blocks 



This subroutine draws a horizontal line of blocks of the predetermined color on the Low-Res 
screen. You should call HLINE with the vertical coordinate of the line in the accumulator, the 
leftmost horizontal coordinate in the Y register, and the rightmost horizontal coordinate in loca- 
tion S2C. HLINE returns with A and V scrambled, X intact. 



SF828 



VLINK 



Draw a vertical line of blocks 



This subroutine draws a vertical line of blocks of the predetermined color on the Low-Res screen. 
You should call VLINE with the horizontal coordinate of the line in the Y register, the top verti- 
cal coordinate in the accumulator, and the bottom vertical coordinate in location S2D. VLINE 
will return with the accumulator scrambled. 



SF832 



< t KM K 



Clear the entire Low-Res screen 



CLRSCR clears the entire Low-resolution Graphics screen. If you call CLRSCR while the video 
display is in Text mode, it will fill the screen with inverse-mode "@" characters. CLRSCR des- 
troys the contents of A and Y. 



SF834 



CLRTOP Clear the top of the Low-Res screen 



CLRTOP is the same as CLRSCR (above), except that it clears only the lop 40 rows of the 

screen. 



63 



SF87I SCRIS Read the Low-Res screen -* 

m 

This subroutine returns the color of a single block on the Low-Res screen. Call it as you would 
call PLOT (above). The color of the block will be returned in the accumulator. No other regis- 
ters are changed. 

SFBIE PRKAD Read ■ Game Controller e>« 

PREAD will return a number which represents the position of a game controller. You should 
pass the number of the game controller (0 to 3) in the X register. If this number is not valid, 

strange things may happen. PREAD returns with a number from SWI to SFF in the Y register. _ 

The accumulator is scrambled R^ 

SFF2D PRF.RR Print "ERR" £ 

Sends the word "ERR", followed by a hell character, to the standard output device. The accu- ~— 

mulaior is scrambled. fc 

SFF4A IOSAVE Save all registers — 

The contents of the 6502's internal registers are saved in locations S45 through S49 in the order , 

A-X-Y-P-S The contents of A and X are changed, the decimal mode is cleared. (Sr 

SFF3F IOREST Restore all registers Pj 

The contents of the 6502's internal registers arc loaded from locations S45 through $49, _ 



64 






i. MONITOR SPECIAL LOCATIONS 






= 



Table 14: Page Three Monitor Locations 


Address* 
Decimal Hex 


Use: 

Monitor ROM Autostart ROM 


1008 S3I0 
100" S3F1 


None. 


Holds Ihe address 
of the subroutine 
which handle-, 
machine language 
"BRK" requests 
(normally SFA59) 


10111 S3F2 
1011 S3F3 


None. 


Soft Entry Vector. 


loi ; 531-4 


None. 


Powcr-up Byte. 


1013 S3F5 

1014 S3F6 

1015 S3F7 


Holds j "JuMP" instruction to the 
subroutine which handles Applesoft II 

■ &■" command-, * Nnrmall) S4( S58 
SIT'. 


I0K. S3F8 

1017 S3F9 

1018 S3FA 


Holds a "JuMP'' Instruction to the 
subroutine which handles 1 SI K 
<i<TRI. Y ] > commands. 


1010 S3FB 

1020 S3FC 

1021 S3FD 


Holds a "JuMP" instruction to ihe 
subroutine which handles Non- 
Maskable Interrupts. 


1022 s ; li 

1023 S3FF 


Holds the address of the subroutine 
which handles Interrupt ReQuesls. 



S9 



• See page l?.i in ihe \ppl.sn(i ll H\st( Refcrtim Mumml 



65 



MINI-ASSEMBLER INSTRUCTION FORMATS 



The Apple Mini- Assembler recognizes 56 mnemonics and 13 addressing formats used in 6502 
Assembly language programming. The mnemonics .ire standard, as used in ihc MOS 
TechnoloR>/S>nertek 65110 Programming Manual (Apple part number A2LO0O3>. hul the 
addressing formats are different Here are Ihe Apple standard address mode formats lor 6502 
Assembly Language 



Table 15: Min 


-Assembler Address Formats 


Mode 


Formal: 


Accumulator 


None. 


Immediate 


tfSivalue! 


Absolute 


Sladdress! 


/eio Page 


Sladdressl 



Indexed Zero I'agc 



S|addrcss|,\ 
S|addressj,Y 



Indexed Absolute 



Sladdressl.X 
Sladdress ,Y 



Implied 



None 



Relative 



Sladdress! 



Indexed Indirect 



:Sladdrcss!.\ I 



Indirect Indexed 



Absolute Indirect 



IS|addressj),V 



(Siaddi 



An [address! consists of one or more hexadecimal digits. The Mini-Assembler interprets 
addresses in ihe same manner that the Monitor does: if an address has fewer than lour digits, n 
adds leading /ero^s; if [| has more lhan four digits, then it uses only the last lour. 

All dollar signs (S), signifying that ihe addresses arc in hexadecimal notation, are ignored by the 
Mini- Assembler and may he omitted. 

There is no syntactical distinction between the Absolute and Zero Page addressing modes. II* you 
give an instruction to ihe Mini-Assembler which i.\n be used in both Absolute and Zero-Page 
mode, then the Mini- Assembler will assemble ihat instruction in Absolute mode if ihe operand 
for that instruction is greater Hun SFF, and u will assemble that instruction in Zero Page mode if 
the operand for thai instruction is less lhan $0100 

Instructions with the Accumulator and Implied addressing modes need no operand. 

.Branch instructions, which use the Relative addressing mode, require the target address of the 
branch. The Mini-Assembler will automatical]) 1 figure out the relative distance lo use in the 
instruction If the target address is more than 127 locations distant from the instruction, then the 
Mini- Assembler wil sound a "beep", place a circumfex l") under the target address, and ignore 
the line. 

If you give the Mini-Assembler the mnemonic for an instruction and an operand, and the 
addressing mode Ol ihe operand cannot he used with the instruction you entered, then the Mini- 
Assembler will not accept the line, 



h«> 



CHAPTER 

MEMORY ORGANIZATION 



70 

n 

7.1 

74 



RAM STORAGE 

IGUR VTION Bl 
ROM STORAG1 
l/OLCK VTIONS 
/l-Kii I'M. I MEMORY MAPS 





bl 



The Apple's 6502 microprocessor can directly reference a total of 65,536 distinct memory loca- 
tions. You can think of the Apple's memory as a book with 256 "pages", with 256 memory loca- 
tions on each page. Tor example, "page $30" is the 256 mentor) 1 locations beginning at location 
S3000 and ending at locution S30FF. Since the 6502 uses two eight-bit bytes to form the address 
of any memory location, you can think of one of the bytes as the pagv number and Ihe other as 
the location within i he page. 

The Apple's 256 pages of memory fall into three categories: Random Access Memory (RAM), 
Read-Only Memory (ROM), and Input/Output locations (I/O). Different areas of memory are 
dedicated to different functions. The Apple's basic memory map looks like this: 



System Memory Map 


Page Number: 
Decimal Hex 




1 
2 


$00 

S0I 
S02 




• 


* 


RAM (48K) 


190 
191 


SBE 
SBF 




192 
193 


SC0 
SCI 




■ 


- 


I/O <2K> 


198 
199 
200 
201 


SC6 
SC7 
SC8 
SC9 






■ 


*- 


I/O ROM <2K) 


?06 

207 


SCE 
SCF 




20S 

209 


SD0 

SD1 




- 


• 


ROM (12K) 


254 
255 


SFE 
SFF 





E 
? 
E 
E 
E 
E 
5 
E 
E 
E 
E 



Figure 5. System Memory Map 



RAM STORAGE 



g 
E 



The area in the Apple's memory map which is allocated for RAM memory begins at the bottom ^ 



68 



- 



or Page Zero and extends up lo the end of Puge 191. The Apple has ihe capacity 10 house from 
4K (4.096 bytes) to 48K (49.152 byles) of RAM on its main circuit board. In addition, you can 
expand the RAM niemor> Of your Apple all Ihe way up lo 64K (65.536 bytes* by installing an 
Apple Language Card (pari number A2B0O06I. This extra I6K of RAM lakes Ihe place of the 
Apple's ROM memory, with two 4K segmenis of RAM sharing ihe 4k range from SD000 lo 
SDFFF, 






Most of your Apple's RAM memory is available to you for the storage Of programs and data 
The Apple, however, does reserve some locations in RAM I'm use of the System Monitor, vari- 
ous languages, and other sysiem functions. Here is .i map of the available areas in RAM 
memorv 



Table 16: RAM Organization ond I sane 



Page Number 
Decimal Hex 



9 

Ifl 
II 



32 

through 

63 



96 

through 
191 



S00 



Sfll 



$02 



S03 

so.; 
$05 
$06 
$07 



S09 
$0A 
S0B 



12 $0C 

through 

31 $IF 



$20 



S3 1 



64 $40 

through 

95 SSF 



S60 



$W ; 



Used l-or 



Sysiem Programs 



Svslem Stack 



GETLN Inpul Buffer 



Monitor Vector Locations 



Text and Lo-Res Graphics 
Primary Page Storage 



Text and Lo-Res Graphics 

Secondary Page Storage 



Hi-Res tiraphics 
Primary Page 
Storage 



Hi-Res Graphics 
Secondary Page 

Storage 



I RLL 



R \M 



Following is a breakdown of which ranges are assigned lo which functions 

Zero Page. Due lo the construciion of the Apple's 6502 microprocessor, the lowermost page in 
the Apple's memory is prime real estate for machine language programs. The System Monitor 
uses about 20 locations on Page Zero: Apple Inieger BASIC uses a few more: und Applesoft II 
BASIC and the Apple Disk Operating System use the rest, Tables 18. 19, 20. and 21 show the 
locations on zero page which are used by these sysiem functions. 

Page One. The Apple's 6502 microprocessor reserves all 256 bytes of Page 1 for use .is a 
"stack* 1 . Even though ihe Apple usually uses less ihan half of this page ai any one time, ii is nm 
easy lo deiermine just what is being used and what is lying fallow, so you shouldn't ir\ to use 



64 



Page 1 10 store an> data. 

Page Two. The GHTLN subroutine, which is used 10 gel inpul lines by most programs and 
languages, uses Page 2 as lis inpul buffer. If you're sure thai you won't be typing any long inpul 
lines, then you can (somewhat) safely store temporary data in the upper regions of Page 2 

Page Three. The Apple's Monitor ROM (both the Autostart and the original) use the upper six- 
teen locations in Page Three, from location S3F0 to SJFF (decimal 101*8 in 1023). The 
Monitor's use of these locations is outlined on page 62. 

Pages K«ur through Seven This 1 ,024- byte range of memory locations is used for the Text and 
Low-Resolution Graphics Primary Page display, and is therefore unusable for storage purposes. 
There are 64 locations in this range which are not displayed on the screen. These 64 locations are 
reserved for use by the peripheral cards (see page 82). 



RAM CONFIGURATION BLOCKS 

The Apple's RAM memory is composed of eight to 24 integrated circuits. These IC's reside in 
three rows of sockets on the Apple board. Each row can hold eighi chips of either the 4.096-bit 
(4K> or 16.384-bn (16K) variety, The 4K RAM chips are of the Mostek "4096" family, and 
may be marked "MK4096" or "MCM66U4" The 16K chips are of Ihe '41 16" type, and may 
have the denomination "MK41I6" or "UPD4I60". Each row must have eight of the same type 
Of chip, although different rows may hold different types. 

A row of etghi 16K IC's represents 16.384 eight-bit bytes of RAM. The leftmost IC in a row 
represents ihe lowermost (least signilicani) bil of every byte in that range, and the nghimusi IC 
in a row represents the uppermosi (most signilicant) bit of every byte. The row of RAM IC's 
which is fronimost on ihe Apple board holds the RAM memory which begins at location in the 
memory map; the next row back continues where the first left off. 

You can tell ihe Apple how much memory it has, and of what type it is. by plugging Memory 
Configuration Blocks into three IC sockets on the left side of the Apple board. These 
configuration blocks are three 14-legged critters which look like big. boxy inlegrated circuits. But 
there are no chips inside of them; only three jumper wires in each. The jumper wires "slrap" 
each row of RAM chips into a specific place in the Apple's memory map. All three configuration 
blocks should be strapped the same way. Apple supplies several types of standard configuration 
blocks for the most common system sties. A set of these was installed in your Apple when it was 
built, and you get a new sel each time you purchase additional memory for your Apple. If. how- 
ever, you want to expand your Apple's memory with some RAM chips that you did not purchase 
from Apple, you may have lo construct your own configuration blocks (or modify the ones 
already in your Apple). 

There are nine different RAM memory configurations possible in >uur Apple. These nine 
memory sizes are made up from various combinations of 4K and 16K RAM chips in the three 
rows of sockets in your Apple. The nine memory configurations ure: 



7Q 




SC*HW I — 



$11000 
SA000 



St.000 
$5000 

$4000 

S3000 

$2000 

$1000 

$0000 

System 

Size 



16K 


















4K 




16K 


I6K 


16K 




4K 




•IK 


4K 




16K 


I6K 


Ink 


I6K 


16K 


16K 




4K 




4K 


4K 




4K 


4K 


4K 





















48K 36K 32K 24K 20K I6K UK 8K 4K 



5=3 



I 'inure ft. Memory Configurations 

Of Ihe fourteen "legs" on each controller block, ihe three in (he upper-right corner (looking al it 
from above! represent the three rows of RAM chips on the Apple's main board. There should 
be a wire jumper from each one of these pins to another pin in the configuration block. The 
"other pin" corresponds lo a place in ihe Apple's memory map where you want the RAM chips 
in each row to reside. The pins on the configuration block are represented thus; 



4K range $0000- 
4K range SI 000- 
4K range S2000- 
4K range S.1000- 
4k range S4000- 
4K range $5000* 
4k range SK000- 



SOI 1 F 


1 


14 


S1FI l 


; 


U 


S2I 1 1 


J 


12 


sun 


4 


a 


S4FFF 


5 


10 


S5FFF 


6 


9 


S8FFF 


7 


8 



Frontmost row i"C"i 
Middle row ("D") 
Buekmost row i'i"i 
No connection 
16K range SWW-S3FFF 
I6K range S4000-S7FFF 
loK range S8000-SBFFF 



Figure 7. Memory Configuration 

Block Pin. mi- 



ll i row contains eight chips of the Ink variety, then you should connect a jumper wire from the 
pin corresponding to that row lo a pin corresponding lo a 16 K range of memory. Similarly, il a 
row contains eighl 4K chips, you should connect a jumper wire from the pin for that row to B pin 
corresponding to a 4K range of memory. You should never put 4K chips in a row strapped lor 
I6K. or vice versa. Il is also not advisable to leave a row unstrapped, or lo strap two rows into 
the same range of memory. 

You should always make sure that there is some kind of memory beginning at location 0. Your 
Apple's memory should be in one contiguous block, but it does not need lo be. For example, if 
you have only three sets of 4K chips, but you want lo use Ihe primary' page of the High- 



71 



Resolution Graphics mode, then you would strap one row of 4K chips to the beginning of 
memory UK range $0000 through S0FFF), and strap the other two rows to the memory range 
used by ihe lligh-Resolulion Graphics primary page (4K ranges S2000 through S2FFF and $3000 
through S3FFF). This will give you 4K bytes of RAM memory to work with, and 8K byies of 
RAM to be used as a picture buffer. 

Notice thai the configuration blocks are installed into ihe Apple with their front edges (the edge 
with the while dot. representing pin 1 1 towards the front of ihe Apple. 

There is a problem in Apples with Revision boards and 20K or 24K of RAM. In ihese systems, 
ihe 8K range of the memory map from S4000 lo S5FFF is duplicated in the memory range $6000 
to S7PFF, regardless of whelher it contains RAM or not. So systems with only 20K or 24K of 
RAM would appear to have 24K or 36K, but ihis extra RAM would be only imaginary. This has 
been changed in Ihe Revision I Apple hoards. 



ROM STORAGE 



The Apple, in its natural stale, can hold from 2K (2,048 bytes) to I2K U 2.288 bytes) of Read- 
only memory on its main board. This ROM memory can include ihe System Monitor, a couple 
of dialed* of the BASIC language, various system and utility programs, or pre-packaged 
subroutines such as are included in Apple's Programmer's Aid it / ROM. 

The Apple's ROM memory resides in the top 12K (48 pages) of the memory map, beginning al 
location $0000 For proper operation of ihe Apple, there must be some kind of ROM in the 
upppermosi locations of memory. When you turn on ihe Apple's power supply, the microproces- 
sor must have some program lo execute, ll goes lo the lop locations in the memory map for the 
address of ihis program. In the Apple, Ihis address is stored in ROM. and is the address of B pro- 
gram within ihe same ROM. This program initializes ihe Apple and lets you siari lo use it. (For 
a description of ihe startup cycle, see "The RFSF'I Cycle*', page 36.) 

Here is a map of the Apple's ROM memory, and of the programs and packages that Apple 
currently supports in ROM: 



Table 17: ROM Organization ami I saui' 


Page Number. 
Decimal He\ 


Used By: 


208 SD0 
212 SD4 
216 $D8 
220 SDC 

224 $E0 
228 SE4 
232 SIS 
236 SEC 
240 SP0 
244 SF4 
248 SF8 
252 SFC 


Programmer's Aid #1 


Applesoft 

II 

BASIC 




Integer BASIC 


Utility Subroutines 


Monitor ROM 


Autostart ROM 



72 



Stx 24-pin K sockets on the Apple's board hold the ROM integrated circuits. Each socket can 
hold one of n type 9316H 2.048-byle by 8-bil Read-Only Memory. The leftmost ROM in ihe 
Apple's board holds ihe upper 2K of ROM in Ihe Apple's memory map; the rightmost ROM \C 
holds the ROM memory beginning at page SD0 in the memory map. If a ROM is not present in 
a given socket, then the values contained in the memory' range corresponding to that socket will 
be unpredictable 

The Apple Firmware card can disable some or all of the ROMs on the Apple board, and substi- 
tute ils own ROMs in their place. When you have an Apple Firmware card installed in any slot in 
Ihe Apple's board, you can disable the Apple's on-hoa rd ROM s by Hipping the card's controller 
Switch to its UP position and pressing and releasing the | RESET I button, or by referencing location 
SC080 (decimal 49280 or -16256). To enable t he Apple 's on-board ROMs again, flip the con- 
troller switch to the DOWN position and press [RESET I . or reference location SC081 (decimal 
49281 or -16255). For more information, see Appendix A of the Applesoft II BASIC Program- 
ming Reference Manual. 



I/O LOCATIONS 

4.096 memory locations ( 16 pages) of the Apple's memory map are dedicated lo input and output 
functions. This 4K range begins at locution SC000 (decimal 49152 or -16384) and extends on up 
to locution SCI I I (decimal 53247 or -12289). Since these functions are somewhat intricate, they 
have been given a chapter all to themselves. Please see Chapter 5 for information on the alloca- 
tion of Input/Output locutions. 



73 



ZERO PAGE MEMORY MAPS 






Table 18: Monitor Zero Pane Usage 



Decimal 
Ilex 

S00 

S10 

S20 
S30 
$40 
S50 

S<-0 

$70 



Sfl 



2 

$2 



3 
S3 



4 

S4 



5 
$5 



6 

S6 



7 
S7 



S^ 



9 

S9 



II 
SB 



12 
SC 



13 

SD 



14 

SI. 



IS 
SF 



16 
32 
48 

64 

*0 

96 

112 
128 

144 
160 
176 
192 
208 
224 
240 



S90 
SA0 
SH0 
SC8 

SD0 
SE0 
SF0 



Tabic 19: Applesoft II BASIC Zero Page Usage 



Decimul 
Hex 



$00 
S10 
S20 
S30 
S40 
80 S50 
96 S60 
112 S70 

i:s S80 

144 S90 

160 SA0 

176 SB0 

192 SC0 

208 SD0 

224 SE0 

240 SF0 



1 2 3 4 5 6 7 8 9 10 II 12 13 14 15 
S0 SI S2 S3 S4 S3 S6 S7 S8 S9 SA SB SC SD SE SF 



M 



■a 



^ 

*» 



Table 20: Apple DOS 3.2 Zero Page Usage 


Decimal 





23456789 10 11 


12 


13 


14 


l> 


Hex 

S00 


$0 SI S2 S3 S4 $5 S6 S7 S8 S9 SA SB 


S( 


SD 


SI 


SF 














16 SI0 














32 S20 














48 S30 










• 


• 


64 S40 














80 S50 














% S60 




• • • • 








• 


112 S70 


• 












128 S80 














144 S90 














160 SA0 












• 


176 SB0 


• 












192 SC0 




• • 


• 


• 






208 SD0 




• 










224 SE0 














240 SF0 















Table 21: Integer BASIC Zero Pace Isage 



•— 
3 
= 



Decimal 
Ilex 

S00 
S10 
S20 
S30 
S40 
S50 
S60 
112 S70 
128 $80 
144 $90 
160 $A0 
176 SB0 
192 SC0 
208 SD0 
224 SE0 
240 SF0 



1 2 3 4 5 6 7 8 9 10 
SI S2 $3 S4 S5 S6 $7 S8 S9 SA 



II 
SB 



12 13 14 15 
SC SD SE SF 



75 



^b 



* 



CHAPTER 

INPUT/OUTPUT STRUCTURE 



bi ii mn i/o 

PER1PH1 KAL BOARD I/O 

PER1PH1 KM CARD l/OSPA< I 

PI KII'IIIKAI. CARD MOM SPA< 1 

I/O PROGRAMMING 5TI0NS 

PI RIPHERAt SKU SCRATC HPAD RAM 

Till CSW/KSW SWITC HE5 

I \l'\\S]u\ ROM 






11 



u- 



The Apple's Input and Ouipui functions full into two basic categories: those functions which are 
performed on the Apple's board iiself. und those functions which are performed by peripheral 
interface cards plugged into ihe Apple's eight peripheral "slots". Both of these functions com- 
municate to the microprocessor and your programs via 4.096 locations in the Apple's memory 
map. This chapter describes (he memnrv mapping and operation of the various input and output 
controls and functions, the hardware which executes these functions is described in the next 
chapter. 



BUILT-IN I/O 

Most of the Apple's inherent I/O facilities are described briefly in Chapter I. "Approaching your 
Apple" For a short description of these facilities, please see thai chapter. 

The Apple's on- board I/O functions are controlled by 128 memory locations in Ihe Apple's — 
memory map, beginning at location SC000 and extending up through location SC07F (decimal 
49152 through 49279, or -16384 through -162571. Twenty-seven different functions share these u 

128 locations. Obviously, some functions are affected by more than one location: in some 
instances, as many as sixteen different locations all can perform exactly the same function. These 
128 locations fall into five types: Data Inputs, Strobes. Soft Switches. Toggle Switches, and flag — 

Inputs 

s 

Data Inputs Ihe onl> Data Input on the Apple board is a location whose value represents the 
current stale of the Apple's buili-m keyboard The uppermost bit of this input is akin to Ihe Flag — 
Input-, (see below); the lower seven bits are ihe ASCII code of the key which was most recently 
pressed on Ihe keyboard. 

H 
Flag Inputs Most huilt-in input locations on Ihe Apple are single-bit "nags' These (lags appear 
in the highest (eighth) bit position in their respective memory locations Flags have only two — 
values: 'on' and 'off". The selling of a Hag can be tested easily from any language. A higher- 5! 
level language can use a "PFHK" or similar command to read the value of a flag location: if ihe 
PEF-Ked value is greater than or equal to 128. then ihe flag is on; if the value is less than 128, £ 
the flag is off Machine language programs can load the contents of a flag location into one of the 
6502 's internal registers (or use the BIT instruction) and branch depending upon the setting of 

N (Sign) flag. A BMI instruction will cause a branch if the flag is on, and a BPI. instruction ^ 
Will cause a branch if (he flag is off. 

The Single-Bit (Pushbutton) inputs, the Cassette input, the Keyboard Strobe, and the Game Con- 
troller inpuls are all of this type. 

Strobe Outputs. The Utility Strobe, the Clear Keyboard Strobe, and the Game Controller Strobe 

are all controlled by memory locations. If your program reads the contents of one of these loca- £ 

tions. then the function associated with lhai location will he activated. In the case of ihe Utility 

Strobe, pin 5 on the Game I/O connector will drop from +5 volts to volts for a period of .98 

microseconds, then rise back to +5 again: in the case of the Keyboard Strobe, the Keyboard's St 

flag input (see above) will be turned off; and in the case of the Game Controller Strobe, all of ihe 

(lag inputs of the Game Controllers will he lurned off and their timing loops restarted, £ 

Your program can also trigger the Keyboard and Game Controller Strobes by writing to their con- 
trolling locations, bui you should not write to the Utility Strobe location. If you do. you will pro- 
duce fwo 98 microsecond pulses, about 24.43 nanoseconds apart, This is due to the method in 
which Ihe 6502 writes to a memory location: first it reads the contents of thai location, then it 



78 



writes over Ihem. This double pulse will go unnoticed for the Keyboard and Game Controller 
Strobes, but may cause problems if it appears on the Utility Strobe. 

I ovule Switches Two oilier strobe outputs arc connected internally to two-Slate "flip-flops" 
Each lime you read from the locution associated with the strobe, its flip-flop will "toggle" lo its 
other state. These toggle switches drive the Cassette Output and the internal Speaker. There is 
no practical way lo determine the setting of an internal toggle switch. Because of the nature of 
(he toggle switches, you should only read from their controlling locations, and not write to them 
(sec Strobe Outputs, above) 

Soft Switches Soli Switches .ire two-position switches in which each side or the switch is con- 
trolled by an individual memory location If you reference the location for one side of the 
switch, it will throw the switch that way; if you reference the location for the other side, n will 
throw the switch the other way It sets the switch without regard to its former setting, and there 
is no way to determine the position a soit switch is in. You can safely write to sofl switch con- 
trolling locations: Iwo putses arc as good as one isee Strobe Outputs, above). The Annunciator 
outputs and all ot the Video mode selections are controlled by soft switches. 

The special memory locations which control the built-in Input and Output functions are arranged 
thus; 



Table 22: Buill-I 


11 l/l ) 1 ok -iln ins 




SCMfl 


S0 SI S2 S3 S4 S5 S6 


S7 S8 S9 SA SB SC SD 


SE IF 


Keyboard Data Input 


M ft[0 
SI fcW 


Clear Keyboard Strobe 


Cassette Output Toggle 


sewn 


Speaker Toggle 






s. tMtf 


Utility Strobe 


M U>H 


*r 


w 


nomta 


mla 


prt 


let 


lores 


hires 


4110 


ml an2 


.m' 


S( i*i.»0 


nit 


pbl 


r*2 


plO 


M 


pet 


ScJ 


B03 


repeal SCMft-SCfl67 


SC070 


Game Controller Strobe 



Key in abbreviations: 

gr Set GRAPHICS mode i\ Set TEXT mode 

nomi\ Set all text or graphics mix Mix text and graphics 

pri Display primary page sec Display secondary page 

lores Display LoW-ReS Graphics hires Display Hi-Res Graphics 



an Annunciator outputs 
ge Chime Controller inputs 



pb Pushbutton inputs 
cin Cassette Input 



PERIPHERAL BOARD I/O 



Along the back of the Apple's main board is a row of eighl long '"slots", or Peripheral Connec- 
tors. Into seven of these eight slots, you can plug any of many Peripheral Interface boards 
designed especially for the Apple. In order lo make the peripheral cards simpler and more versa- 
tile, the Apple's circuitry has allocated a total of 280 byte locations in the memory map For each 



7G 



of seven slots. There is also a 2K byte "common area", which all peripheral cards in your Apple 
can share 

Each sloi on Ihc board is individually numbered, wilh Ihe leftmost slot called "Slot 0" and the 
rightmost culled "Slot 7". Slot is special: it is meant for RAM. ROM, or Interface expansion. 
All other slots (I through 7) have special control lines going lo them which are active al different 
limes for different slots. 



PERIPHERAL CARD I/O SPACE 



Each slot is given sixteen locations beginning al location SC080 for general input and output pur- 
poses. For slot 0. these sixteen locations fall in the memory range SC080 through SC08F. for 
slot 1, they're in the range SC090 through SC09F, el cetera, Each peripheral card can use these 
locations us it pleases. Each p eripheral card can determine when il is being selected by listening to 
pin 41 (called DEVICE SELECT) on its peripheral connector. Whenever the voltage on this pin 
drops to volts, the uddress which the microprocessor is calling is somewhere in that peripheral 
card's 16-byte allocation. The peripheral card can then look at ihe bottom four address lines to 
determine which of its sixteen addresses is being culled. 



Table 23: Peripheral Card I/O Locations 


SC080 


$0 


SI 


S2 S3 S4 S5 $6 S7 S8 S9 SA SB SC SD SE SF 











SC090 








1 


SC0A0 








2 


SC0B0 






Input/Output for slot number 


3 


SC0C0 








4 


SC0D0 








5 


SC0E0 








6 


S< '0F0 








7 



PERIPHERAL CARD ROM SPACE 

Each peripheral slot also has reserved for it one 256-byte page of memory. This page is usually 
used to house 256 bytes of ROM or Programmable ROM <PROM> memory, which contains driv- 
ing programs or subroutines lor the peripheral card. In this way. the peripheral interface cards 
can be "intelligent": they contain their own driving software; you do not need lo load separate 
programs in order to use the interface cards. 

The page of memory reserved for each peripheral slot has ihe page number SC«, where « is the 
slot number. Slot does not have a page reserved for il. so you cannot use most Apple interface 
cards in that slot. The signal on Pin I (called f/O SELECT) of each peripheral slot will become 
active (drop from +5 volts to ground) when the microprocessor is referencing an address within 
lhai slot's reserved page. Peripheral curds can use this signal to enable their PROMs. and use the 
lower eight address lines lo address each byte in the PROM 



si i 



Tabic 14: Peripheral ( aril PROM 1 ocalions 


sciefl 


S00 sio s:o s.w s-in s>n ShO s^i sm s»o s.\o sun sen sin' sin mh 




1 


SC200 




2 


SC300 




3 


SC400 


PROM space lor sloi number 


4 


SC500 




> 


SC600 




6 


SC700 




7 



- I/O PROGRAMMING SUGGESTIONS 



m 



The programs in peripheral card PKOMs should be portable; thai is. they should be able 10 func- 
tion correctly regardless Of where they are placed tn the Apple's memory map. They should con- 
lain no absolute references to themselves. They should perform all JuMPs with conditional or 
forced branches. 

Of course, you can fill a peripheral card PROM with subroutines which are inn portuble. and your 
only loss would be that the peripheral card would be slot-dependent. If you're cramped for space 
in a peripheral card PROM, you can save many bytes by making ihe subroutines slot-dependent. 

The first thing thai a subroutine in a peripheral card PROM should do Is to save ihe values of all 
of the 6502's internal registers. There is a subroutine called IOSAVL in the Apple's Monitor 
ROM which does just this. It saves the contents of all internal registers in memory locations M5 
through S49, in ihe order A-X-Y-P-S. This subroutine starts al location SFF4A. A companion 
subroutine, called IORFSTORL. restores otfof the internal registers from these storage locations. 
You should call this subroutine, located at SFF3F, before your PROM subroutine finishes. 

__ Most single-character input and output is passed in the 6502's Accumulator During ouiput, the 
■S character to be displayed is in the Accumulator, wilh its high bit set. During input, your 
Bittuniitlna ..tiiiiiiii noov iha rh'inrior rpi'»ivi>il from ihe inniii ilt'vii*!' in ihi* Accumulator, also 



subroutine should pass the character received from the input device 
with its high bit set. 



A program in a peripheral card's PROM can determine which slot the card is plugged into by exe- 
cuting this sequence of instructions: 



0300- 


20 4A 


FF 


JSR 


SFF4A 


0303- 


78 




SEI 




0304- 


20 58 


FF 


JSR 


SFF58 


0307- 


BA 




IS\ 




3 08- 


BD 00 


0) 


1 DA 


$0100. X 


30B- 


8D F8 


07 


SI \ 


S07F8 


030E- 


^ MH 




AND 


#$0F 


03 10- 


A8 




TAY 





After a program executes these steps, the slot number which its card is in will be stored in the 
6502's Y index register in the format S0«. where n is the slot number. A program in ihe ROM 
can further process ihis value by shifting it four bils to ihe loft, to obtain S'/0. 



03 1 1- 



98 



1 \ A 



M 



03 12- 


0A 


\S1 


03 13- 


0A 


ASL 


03 14- 


0A 


ASL 


0315- 


0A 


ASL 


3 1 <> - 


\A 


1 \\ 



A program can use (his number in the \ index register wiih ihe 6502*3 indexed addressing mode 
lo refer lo ihe sixteen I/O locations reserved for each card. For example, the instruction 



0317- 



BD 80 C0 



I U\ 



SC080.X 



will luad the 6502'* accumulator with the contents ol" the first I/O location used by the peripheral 
card The address SC080 is the base address Tor the hrst location used by all eight peripheral 
slots. The address SC0S1 is Ihe base address lor the second I/O location, and so on. Here are 
the base addresses lor all sixteen I/O locations on each card 



Tabic 25: I/O Locution Base Addresses 


Base 








Slot 








Address 





1 


2 


3 


4 


s 


6 


7 


SC0X0 


Si tflHifl 


SC090 


SC0A0 


SC0B0 


SC0C0 


SC0D0 


SC0F0 


SC0F0 


5C081 


SC08I 


SC09I 


SC0A1 


SC0B1 


scaci 


SC0D1 


SC0E1 


SC0FI 


SC082 


SC082 


SC092 


SC0A2 


SC0B2 


SC0C2 


SC0D2 


5C0E2 


SC0F2 


SC083 


SC083 


SC093 


SC0A3 


SC0B3 


SC0C3 


SC0D3 


SC0E3 


SC0F3 


SC084 


SC084 


SC094 


SC0A4 


SC0B4 


SC0C4 


SC0O4 


SC0E4 


5C0F4 


SC085 


SI OV 


SC095 


SC0A5 


SC0B5 


SC0C5 


SC0D5 


SC0E5 


S( 01 > 


SC086 


SC086 


SC09(> 


SC0A6 


SC0B6 


SC0C6 


SC0D6 


S< 01 


SC0F6 


SC087 


Si 0>: ' 


SC097 


SC0A7 


SC0B7 


SC0C7 


SC0D7 


M 01 ' 


SC0F7 


SC088 


SC088 


SC098 


SC0A8 


SC0B8 


SC0C8 


SC0D8 


SC0E8 


SC0F8 


SC089 


S( 0^ 


SC099 


SC0A9 


SCBB9 


SC0C9 


SC0D9 


SC0F9 


SC0F9 


SC08A 


SC08A 


SC09A 


SC0AA 


SC0BA 


SC0CA 


SC0DA 


SC0EA 


SC0FA 


SC08B 


SC08B 


SC09B 


SC0AB 


SC0BB 


SC0CB 


SC0DB 


SC0EB 


SC0FB 


SC0SC 


SC08C 


SC09C 


SC0AC 


SC0BC 


SC0CC 


SC0DC 


SC0EC 


SC0FC 


SC08D 


SC08D 


SC09D 


SC0AD 


SC0BD 


si oi i ) 


SC0OD 


SC0ED 


SC0FD 


5C08E 


SC08E 


SC09E 


SC0AO 


SC0BE 


SC0CE 


SC0DE 


SC0FF 


SC0FE 


SC08F 


SC08F 


SC09F 


SC0AF 


SC0BF 


SC0CF 


SC0DF 


SC0EF 


SC0FF 










I/O Locations 









PERIPHERAL SLOT SCRATCHPAD RAM 

Each of the eight peripheral slots has reserved for it 8 locations in ihe Apple's RAM memory. 
These 64 locations are actually in memory pages S04 through S07, inside the area reserved for the 
Text and Low-Resolution Graphics video display. The contents of these locations, however, arc 
not displayed on the screen, and their contents are not changed by normal screen operations " 
The peripheral cards can use these locations for temporary storage of data while the curds are in 
Operation. These "scratchpad" locations have the following addresses: 



• Set Bui Son '". iugc .11 



B2 





Table 26: I 


f() Scralclipud It \M Addresses 




Base 






Sloi Number 






Address 


1 


2 


3 


4 


5 


6 


7 


S9478 


S0479 


S047A 


S047B 


S047C 


S0WI) 


$0471 


S047F 


$04 rs 


S04F9 


$041 A 


S04FB 


S04FC 


$041 D 


S04FF 


S04F1 


S0578 


S0579 


S057A 


S057B 


S057C 


S057D 


S057F 


S057F 


505 rs 


S05F9 


S05FA 


S05FB 


S05FC 


S05FD 


S0SFE 


S05FF 


S0678 


$0679 


S067A 


S0O7B 


S067C 


S067D 


$067 F 


S067F 


S06F8 


S06F9 


S06FA 


S06FB 


S06FC 


S06FD 


$06 FL 


S06FF 


S0778 


S0779 


S077A 


S077B 


S077C 


S077D 


S077F 


S077F 


S07FS 


$07 1 9 


S07FA 


S07FB 


S07I i 


S07FD 


$07 FL 


S07FF 



^5 



Sloi does noi have any scratchpad RAM addresses reserved for il. The Base Address locations 
arc used by Apple DOS 3.2 and are also shared by all peripheral cards. Some of these localions 
have dedicated functions: location S7F8 holds the slot number (in the fnrmai SC»i> of the peri- 
pheral card which is currently active, and location S5F8 holds the slot number of the disk con- 
troller card from which any active DOS was honied. 

By using the slot number S0». derived in the program example above, a subroutine can directly 
reference any of its eight scratchpad locations: 



3 1 A - 


B9 


"^ 


04 


LDA 


S047K 


Y 


031D- 


99 


F8 


04 


SI A 


S04F8 


Y 


0320- 


B9 


78 


05 


IDA 


S0578 


Y 


0323- 


99 


F8 


05 


STA 


S0 5F8 


Y 


0326- 


B9 


78 


06 


LDA 


S0678 


Y 


0329- 


99 


FK 


06 


STA 


S06F8 


> 


03 2C- 


B9 


78 


07 


LDA 


S0778 


Y 


3 2 F - 


99 


1-8 


07 


M \ 


S0 7F8 


^ 



= THE CSW/KSW SWITCHES 



■3 



The pair of localions S36 and S37 (decimal 54 and 55 > is called CSW, for "Character output 
SWitch". Individually, locution S36 fs called CSWL (CSW Low) and location S37 is called 
CSWH (CSW High). This pair of localions holds the address of the subroutine which the Apple 
is currently using for single-character output. This address is norm ally SFP I-0. the address of the 
COUT subroutine (see page 30). The Monitor's PRINTER ( IC'TRL P| ) command, and ihe 
BASIC command PR#, can change this address to be the address of a subroutine in a PROM on 
a peripheral card. Boih of these commands put ihe address SC«00 into this pair of locations, 
where ;/ is the slot number given in the command. This is the address ol the first location in 
whatever PROM happens in be on the peripheral card plugged into that sloi. The Apple will then 
call ihis subroutine ever\ time it wishes lo output one character. This subroutine can use ihe 
instruction sequences given above to find iis slot number and use the I/O and RAM scratchpad 
locations for iis slot When il is finished, it can either execute an RTS (ReTurn from 
Subroutine) instruction, to return lo the program or language which is sending Ihe output, or il 
can jump to the COUT subroutine at location SFDF0. to display the character on the screen and 
then return lo the program which is producing oulpui. 

Similarly, localions S38 and 39 (decimal 56 and 57). called KSWL and KSWM separately or KSW 



83 



'Keyboard input S Witch) together, hold the address of the subroutine the Apple is currently 
using for single-character input. This address is nor mally SF D1B, the address of the KHYIN 
subroutine. The Monitor's KEYBOARD command <1 CTRL K| ) and the BASIC command IN# 
both change this address lo SC/J00. again with n the slot number given in the command. The 
Apple will call the subroutine at the beginning of the PROM on the peripheral card in this 5lol 
whenever it wishes 10 get a single character from the input device. The subroutine should place 
the input character into the 6502*s accumulator and ReTurn from Subroutine (RTS) The 
subroutine should set the high bit of the character before it returns. 

The subroutines in a peripheral card's PROM can change the addresses in the CSW and KSW 
switches to point to places in the PROM other than the very beginning. For example, a certain 
I'Kt )M could begin with a segment of code to determine what slot it is in and do some initializa- 
tion, and then jump in to the actual character handling subroutine. As part of its Initialization 
sequence, it could change KSW or CSW (whichever is applicable) to point directly lo the begin- 
ning of the character handling subroutine. Then the next lime the Apple asks for input or output 
from that card, the handling subroutines will skip the already-done initialization sequence and go 
right in to the task at hand. This can save time in speed-sensitive situations 

A peripheral card can he used for both input and output if its PROM has seperate subroutines for 
the separate functions and changes CSW and KSW accordingly, The initialization sequence in a 
peripheral card PROM can determine If it is being called for input or output by looking at the 
high parts of the CSW and KSW switches. Whichever switch contains SCw is currently calling 
that card lo perform its function. If both switches contain SC». then your subroutine should 
assume that it is being called for output. 



EXPANSION ROM 

The 2K memory range from location SC8UH to SCFFF is reserved for a 2K ROM or PROM on a 
peripheral card, lo hold' large programs or driving subroutines. The expansion ROM space also 
has the advantage of being absolutely located in the Apple's memory map. which gives you more 
freedom in writing your interface programs. 

This PROM space is available lo all peripheral slots, and more than one card in your Apple can 
have an expansion ROM. However, only one expansion ROM can be active at one nme. 

Each peripheral card's e xpansion ROM sho uld have a flip-flop to enable it This flip-flop should 
be turned "on" by the DhVK'l. SliU-CI signal tthe one which enables the 256-byte PROM). 
This means that ihe expansion ROM on any card will be partially enabled a fter you tirst reference 
the card it is on. The other enable to the expansion ROM should be the I/O STROBE line, pin 
20 on each peripheral connector. This line becomes active whenever the Apple's microprocessor 
is referencing a location inside the expansion ROM's domain. When this line becomes active, 
and ihe aforementioned flip-flop has been turned "on", then the Apple is referencing ihe expan- 
sion ROM on this particular hoard (sec ligure 8). 

A peripheral card's 256-byte PROM can gain sole access to the expansion ROM space by referring 
to locution SCFFF in its initialization subroutine. This location is a special location, and all peri- 
pheral cards should recognize it as a signal to lurn their flip-flops "off" and disable their expan- 
sion ROMs. Of course, this will also disable the expansion ROM on Ihe card which is trying lo 
grab the ROM space, but the ROM will be enabled again when the microprocessor gets another 
instruction from the 256-byte driving PROM. Now the expansion ROM is enabled, and iis space 
is clear. The driving subroutines can Ihen jump directly into the programs in the ROM. where 



v: 



GEEZZ3~ 



c 



) 



Figure 8. Expansion ROM Enable Circuit 



they can enjoy [he 2K of unobstructed, absolutely located memory space: 



332- 


2C FF CF 


BIT 


SCFFF 


33 5- 


4C 00 C8 


J MP 


SC800 



ll is possible to save circuitry (al the expense of ROM space) on the peripheral card by not fully 
decoding the special location address. SCFFF. In fact, if you can afford to lose the last 256 bytes 
of your ROM space, the following simple circuit will do just line: 




Figure 1. SCFXX DvcodinR 



85 



far 

fit 



Bti 



J 
5 



CHAPTER 

HARDWARE CONFIGURATION 




rut MICROPRO 
SYST1 M HMING 
POWEB 

RAM MEM* 

TOE VII M' »K 

R l .11 Ml 

K I "i Bl IARO 

SPE K\ 

Pi KM IB IX)RS 



THE MICROPROCESSOR 



The 65M2 Microprocessor 




Model 


MCS6502/SY6502 


Manufactured by: 


MOS Technology. Inc 

Syneriek 

Rockwell 


Number of instructions: 


56 


Addressing modes; 


13 


Accumulator?}: 


1 (A) 


Index registers: 


2 (X,Y) 


Other registers 


Stack pointer <S> 

Processor status <P' 


Stack: 


256 bytes, lived 


Sliitus Hags; 


N (sign) 

C (carry) 
V (overflow ) 


Other Hags; 


1 (Interrupt disable) 
D (Decimal arithmetic) 

B 1 Break! 


Interrupts; 


2 (IRQ- NMI) 


Resets: 


1 (RES) 


Addressing range: 


2 16 <64KJ locations 


Address bus: 


lb bits, parallel 


Data bus: 


8 bits, parallel 
Bidirectional 


Voltages 


1 5 volts 


Power dissipation: 


.25 watt 


Clock frequency; 


I 023MHz 



The microprocessor yets its main timing signals. <M4 and «M. from the timing circuits described 
belOW These are complimentary I.023MH/ clock signals. Various manuals, including the MOS 



sS 






Peripheral Connectors 



Power 

Connector 



USER I 

Juniper 



=5 
= 




Lur.ipple 
Jumpers 



Kiyure 10. The Apple Main Board 



89 



Technology Hardware manual, use the designation 4»2 for ihe Apple's <1>0 clock 

The microprocessor use-, its address and data buses only during ihe time period when W is 
active When <I>tf is low, ihe microprocessor is doing internal operations .md does nut need the 
data and address buses. 

The microprocessor bus a 16-bii address bus and an 8-bii bidirectional data bus. The Address bus 
lines are buffered by three 8T97 three-state buffers ai board locations H3. H4. .md H5. The 

address lines are held open onl) during a DMA cycle, and are acme ,ii .ill other times. The 
address on Ihe address bus becomes valid aboul 300nS after 'M goes high and remains valid 
through all of <1>0. 

fhe Jala bus is buffered through two 8T28 bidirectional Ihrec-stale butlers al board locations II ID 
and llll Data from the microprocessor Is put onto Ihe bus about 300ns after <M and the 
RliAH/WRITF signal (R/W) both drop to zero. At all other limes, the microprocessor is either 
listening to or ignoring the data bus. 

The RDY. RES. IRQ. and NMI lines to the microprocessor arc all held high by 3 3K Ohm resis- 
tors lo +-5v, These lines ,ilsi. appear on the peripheral connectors (sec page 105) 

The SHI OVERFLl >\V (SO) line to the microprocessor is permanently lied lo ground. 



SYSTEM TIMING 



Table 27: I imlng Signal Descriptions 



I4M Master Oscillator output, 14.318 MHz. All timing signals ,re 

derived from this signal. 



7M: 



Intermediate timing signal. 7.15') Mil/: 



COD >R KIT Color reference frequency, 3.580MHz. Used by the video gen- 
eration circuitry. 

$0 <<l>2> : Phase system clock. I.023MH/. compliment lo 'I'l 

<1>I. Phase I system clock. 1.023 Mil/, compliment to '1'0. 

Q3: A general-purpose timing signal, twice the frequency of the ays* 

lem clocks, but asymmetrical 



All peripheral connectors get the liming signals 7M. <I»0. 4*1, and Q3. The liming signals 
and COLOR RI : F are nol available on the penpherul connectors. 



I4M 



M 



b 






500 



<1>0 



"I 




- 

= «t»i — i 



- 



03 



_f 



300 
nscc 



6502 



AJilt-Jss / X 



a 

Data from 6502 (read) 
. ■? Data to 6502 (write) 

U 

U 

u 
u 

I r 



I 



i r 



^ 



.1(10 



X 



xz 



l_ 



r 



100 nsec 



>cxz: 

I ^ 



V See 6502 Hardware 
' manuals for details. 



figure II. Tiiniiif* Signals and Relationships 



91 



POWER SUPPLY 



The Apple Power Supply (I . S. Patent #4,130,862) 



Input voltage. I07 VAC lo 13: VAC, or 

214 VAC in 264 \ \< 
tswiich selectable*) 

Suppi> voltages: +5 '» 
+ 11.8 
-12.0 
-5 2 

Power Consumption: fill walls max. (full load) 

79 wans m.tv (intermittent**) 

lull load power oulpul: + 5\ 2.5 .imp 
-5v: 250ma 

+ I2v: 1.5 amp <— 2.5 amp intermittent*' 
-I2v: 250mA 

Operating temperaiure: 55c ' 131* Farenhcit) 



The Apple Power Supply is a high-voltage "switching" power supply. While mosl oiher power 
supplies use a large transformer with many windings to convert the inpul voltage inlo many lesser 
voltages and then rectify and regulate these lesser voltages, the Apple power supply first converts 
the AC line vol 1 age inlo a DC voltage, and then uses this DC voltage to drive a high-frequency 
oscillator The outpui of this oscillator is led into a small transformer with many Windings. The 
voltages On the secondary windings are then regulated lo become the output voltages 

The f 5 voir output voltage is compared to a reference voltage, and the difference error is fed 
back inio the oscillator circuit. When the power supply's oulpul starts lo move nut of Its toler- 
ances. Ihe frequency of the oscillator is altered and the voltages return to Iheir normal levels. 

If by chance one of the output voltages of the power supply is short-circuited. .i feedback circuit 
in the power supply stops the oscillator and cuts all outpui circuits. The power supply then 
pauses for about ": second and then attempts lo restart the oscillations, If the output is still 
shorted, it will stop and wail again It will continue this cycle until the short circuit is removed or 
the power is turned oh*". 

If the outpui connector of ihe power supply is diseonnceied from the Apple board, the power 
supply will notice this "no load" condition and effectively short-circuit itself. This activates the 
proleciion circuits described above, and cuts all power outpui. This prevenls damage to the 
power supply's internals 



* pie volume -.dccirii switch is not prcK-ni on some Apples 

The [UMttf lUppt) am run 20 minuies with .in iniermiltcm louif il fulloued by lit minute .it normal lu.ul 
-"horn danugti 



M 



-5 



\ 

III 



.•• 



* 




i 






■' 



* 4 






• 



I 



"I ' 






... 



J - 



- 



+ 






a 






••:; 



ff]| ^ 



_ 



T .. * .' 



I 



. 



Figure 12. Power Supph Schematic Drawing 



93 



If one of the ouiput voltages leaves its tolerance range, due to an.) problem either within or 
exlernal lo the power supply, n will again shut itself down lo prevent damage to the components to 
on Ihe Apple hoard This insures thai all voltages will either be correct and in proportion, or they 
will he shut oft" — 

B 

When one of the above faull conditions occurs, the internal protection circuits will slop the oscil- 
lations which drive the transformer. After a short while, Ihe power supply will perform B restart _ 
cycle, and jtiempt to oscillate again. If ihe fault condition has not been removed, the supply will 
again shut down. This cycle can continue Infinitely without damage to the power supply. Each — 
lime the oscillator shuts down and restarts, iis frequency passes through the audible range and — 
you can hear ihe power supply squeal and squeak. Thus, when a fault occurs, you will heai a 
Stead) "click click click" emanating from ihe power supply. This is your warning thai something a* 
is wrong with one of the voltage ouipuis. 

Under no circumstances should you apply more than 140 VAC lo ihe input of ihe transformer — 

(or more than 280 VAC when the supply's switch is in the 220V position!. Permanent damage lo 

Ihe supply will result. a> 

You should connect your Apple's power supply lo a properly grounded 3-wirc outlet. It is very — 
important that the Apple be connected, to a good earlh ground. — 

CAUTION: There arc dangerous high voltages inside ihe power supply's case. Much of the m 
internal circuitry is no' isolated from the power line, and special equipment is needed for service. 
DO NOT ATTEMPT TO REPAIR VOIR POWER SUPPLY! Send it 10 your Apple dealer for 



ROM MEMORY i 

The Apple can support up lo six 2K by 8 mask programmed Read-Only Memory ICs. One of * 
these six ROMs is enabled by a 74LS138 at location F12 on the Apple's board whenever the 
microprocessor's address bus holds an address between SD000 and SFFFF. The eight Data out- — 

puis of all ROMs are connected lo ihe microprocessor's data line buffers, and ihe ROM's address 
lines are connected to ihe buffers driving the microprocessor's address lines A0 through A10. 

i 

The ROMs have three "chip select" lines lo enable ihem. CSI and CS3, both active low, arc 
connected together to the 74LSI38 at location FI2 which selects t he in dividual ROMs. CS2, - 

which is active high, is common to all ROMs and is connected to ihe INH (ROM Inhibit) line on - 

the peripheral connectors. If a card in any peripheral slot pulls this line low, all ROMs on the 
Apple board will be disabled. m 

The ROMs are similar lo type 2316 and 2716 programmable ROMs However. Ihe chip selects 

on most of these PROMs are of a different polarity, and they cannot be plugged directly into the — 

Apple board. 



94 



A7 


/ O 


24 


A6 


■* 


23 


A 5 


3 


22 


A4 


4 


21 


A3 


5 


20 


M 


6 


/v 


Al 


7 


IS 


A0 


a 


17 


1)0 


v 


16 


D1 


10 


IS 


D2 


II 


14 


Gnd 


12 


It 



+5\ 

A8 
A9 



(SI 

AI0 

CS2 

D7 

D6 

D5 

D4 

D3 



Figure 13. V3I6B ROM Pinnut. 



^ RAM MEMORY 



The Apple uses 4K and I6K dynamic RAMs for its main RAM storage. This RAM memory is 
used by bolh ihc microprocessor and ihe video display circuitry. The microprocessor and ihe 
video display interleave iheir use of RAM: Ihe microprocessor reads from or writes to RAM only 
during <W9, and the video display refreshes its screen from RAM memory during *1. 

The three 74LS153s al Ell. EI2. and E13. the 74LS283 at E14. and half of the 74LS257 al C12 
make up the address multiplexer for the RAM memory. They take the addresses generated by 
the microprocessor and the video generator and multiplex them onto six RAM address lines. The 
other RAM addressing signals. RAS and CAS. and the signal which is address line 6 for 16K 
RAMs and CS for 4K RAMs. are generated by the RAM select circuit. This circuit is made up of 
two 74LS139s at E2 and F2. half of a 74LS153 at location CI. one and a half 74LS257s al C12 
and Jl. and the three Memory Configuration blocks at Dl. El, and Fl. This circuit routes sig- 
nals to each row of RAM, depending upon what type of RAM <4K or 16K) is in that row. 

The dynamic RAMs are refreshed automatically during <1>1 by the video generator circuitry. Since 
the video screen is always displaying al least a IK range of memory, it needs to cycle through 
every location in that IK range sixty times a second. It so happens thai this action automatically 
refreshes every bit in all 48K bytes of RAM. This, in conjunction with ihe interleaving of ihc 
video and microprocessor access cycles, leis the video display, the microprocessor, and the RAM 
refresh run at full speed, without interfering with each other. 

The data inputs to the RAMs are drawn direcily off of the sysiem's data bus. The daia outputs of 
the RAMs are latched by two 74LS174s at board locations B5 and B8. and are multiplexed with 
the seven bits of data from the Apple's keyboard. These latched RAM outputs are fed directly to 
the video generator's character, color, and dot generators, and also back onto the system data bus 
by two 74LS257s at board locations B6 and B7. 



M 



-5v 


/ O 


16 


1 1 nia In 


j 


f$ 


U / \\ 


l 


14 


r \s 


J 


IJ 


V5 


« 


12 


A4 


f> 


II 


A3 


7 


ID 


+ I2v 


S 


V 



Gnd 
CAS 

Data nut 
CS 

\2 
\\ 
A0 
+ 5v 



-5v 


/ O 


16 


Data In 


> 


15 


R/W 


3 


14 


RAS 


4 


13 


A5 


5 


12 


A 4 


n 


II 


A3 




II) 


+ 12v 


S 


9 



Gnd 
CAS 
Dale OUI 

A6 

\; 

AI 
\% 

+5v 



40% 4K RAM 

Pi no u i 



41 



6 I6K RAM 

Pinoui 



Kiuure 14. RAM Piiiouts 



THE VIDEO GENERATOR 



There are 192 scan lines on the video screen, grouped Eo 24 lines of eight scan lines each- Each 
scan line displays some or all of the contents of forty bytes of memory. 

I he video generation circuitry derives lis synchronization and liming signals from a chain of 
74LSI61 counters at board locations Oil through DI4. These counters generate fifteen syn- 
chronization signals 

H0 III 112 H3 H4 H5 

V0 VI V2 V3 V4 

VA VB VC 

The "W family of signals is the horizontal byte position on the screen, from 000000 to binary 
1001 II (dedmul 39). The signals V0 through V4 are the vertical line position on the screen. 
rrom binarj 00000 to binary 10111 (decimal 23), The VA. VB. and VC signals arc the vertical 
scan line position wflhfn the vertical screen line, from binary 000 to 1 1 1 (decimal 7). 

These signals are sent to the RAM address multiplexer, which turns them into the address of a 
single RAM location, dependent upon the setting of Ihe video display mode soft switches (see 
below) The RAM multiplexer then sends this address to the array of RAM memory during 'I>1. 
The latches which hold the RAM data sent by the RAM array reroute it lo the video generation 
circuit The 741 S2S3 at location rearranges the mentors addresses so lhat ihe memory mapping 
on the screen is scrambled 

If the current area on the screen is to be a text character, then the video generator will route the 
lower six bits of the data to a type 2513 character generator ul location A5. The seven rows in 
each character are scanned by the VA, VB. and VC signals, and Ihe output Of the character gen- 
erator is serialized into a stream of dols by a 74166 .it location A3. This bit slreum is muted to 
an exclusive-OR gale, where il is inverted if the high bit of the data byie is off and either the 
sixth bit is low or ihe 555 limer at location h*3 is high. This produces inverse and (lashing charac- 
ters. The text bil stream is then sent lo ihe video selector/multiplexer (below). 

If the Apple's video screen is in a graphics mode, then the data from RAM is sent to two 
74LS194 shil'l registers at board locations B4 and B*J Here each nyhhlc is turned into Ft serial 
data stream. These two data streams are also sent to the video selector/multiple-': 



% 



The 74LS257 multiplcxci at board position A8 selects between Color and High-Resolution graph- 
ics displays. The serialized Hi-res u< »i stream is delayed one-half clock cycle h> the 74LS74 at 
location a 1 1 ii the high bii of Lhe byte is scL This produces the alternate color set in High- 
Resolution graphics mode 

The video selector/multiplexer mixes the Iwa data streams from the above sources according to 
the selling of the video screen soft switches. The 74LSI94 .il location All) and the 74LSI5I al 
A9 select one Of the serial bit streams for text, color graphics, or high-resolution graphics 
depending upon the screen mode The final serial output is mixed with the composite synchroni- 
sation signal and Lhe color burst signal generated by the video sync circuits, and sent to lhe video 

output connectors. 

The video display soft switches, which Control the video modes, are decoded a* part of the 
Apple's on-board I/O functions. Logic gates in board locations 1)12. 1113. 1111, A 1 2. and All are 
used tit control the various video modes. 

The color bursi signal is created h\ logic gates .it 1112. 1113, and C13 and is conditioned by R5. 
coil LI, C2. and trimmer capacitor C3. This trimmer capacitor can be luned to vary the tint of 
colors produced by the video display. Transistor Q6 and its companion resistor R27 disable the 
color burst signal When the Apple in displaying text. 



= VIDEO OUTPUT JACKS 

S lhe video signal generated hy the aforementioned circuitry is an NTSC compatible, similar to an 
ElA standard, positive composite video signal which can be fed to any standard closed-circuit or 
^^ studio video monitor This signal is available in three places on the Apple board: 

\U \ .lack On the back of the Apple board, near the right edge, is a standard RCA phono jack, 
^3 The sleeve of this jack is connected to the Apple's common ground and the lip is connected to 

the video output signal through a 200 Ohm potentiometer. This potentiometer can adjust the 
^^ voltage on this connector from to I voli peak 

M Auxiliary Video Connector On the right side of the Apple board near the back is a Molex 

^5 KK100 series connector With four square pins. 25" tall, on 10" centers. This connector supplies 
the composite video output and two power suppl> voltages. This connector is illustrated in figure 
—5 15 





Table 2K: 


Auxiliiirv Video Output Connector Signal Descriptions 


Fin 


Name 


Description 


1 


GROUND 


System common ground; volts. 


: 


VI 11 HO 


NTSC compatible positive composite Video Black level is 
about .75 volt, white level about 2.0 volt, sync lip level is 
volts. - Output level is not adjustable This is nol protected 
against short circuits. 


> 


+ I2v 


+ 12 volt power supply. 


4 


-5v 


— 5 volt line from power supply 



97 



Auxiliun Video Pin rhis single metal wire-wrap pin below Ihe \uuiur\ Video Output Connec- 
loi supplies the same video signal available on thai connector, li is meant 10 be a conneetTon 
pnini for Eurapplc PAI /SI t wi encoder boards 



a s q 



O 

UJ Q 



□ 




o 




a 




a 



H 



.Connector 



Pin 



Figure 15. Au\ili:ir> \ ideo Output Conoector and Pin. 



BUILT-IN I/O 

Ihe Apple's built-in l/o functions are mapped into 1 2S memorj locaiions beginning nl S( 00fl 
On ihe Apple board, a 74LS138 at location FI3 called the I/O selector decodes these 12s - 
addresses and enables the various functions 

The 74LS138 is enabled b\ another '138 al location II 12 whenever the Apple's address bus con- 
tains an address between SltfM and St 01 I ihe I/O selector divides this 256-bytc range into 
eight spleen-byte ranges, ignoring Ihe range 5C080 through SC"**i I Each output line of the '138 
becomes active flow) when its associated 16-byte range is being referenced, 

The "0" line from the I/O selector gates the data from the keyboard connector Into the RAM 
data multiplexer! 

The •]" line lYom the I/O sclccioi resets the 74LS74 dip-flop al BIO. which is the keyboard flag. 

The "2" line toggles one half of a 74LS74 .it location KI3, The output Of this flip-llop is con- 
nected through a resistor network to ihe tip of the cassette output jack. 

The ".V hue toggles ihe other hall Of ihe 74LS74 nl KI3. The output of this nip-flop is con- 
nected through a capacitor and Darlington amplifier circuit to ihe Apple's speaker connector on 
Ihe right edge of the hoard under the keyboard. 

The "4" line is connected directly to pin 5 of the Game I/O connector Ihis pin is ihe uiiliix 
effWSTROBL 

Ihe "5" line is used to enable the "Ml JJ259 at location F14. This \C contains the soil switches 
for Ihe video display and the dame I/O vonneelor annunciator ouiputs. The switches are selected 



M 



by the address tines I through 3 and ihe selling of each switch is controlled by address line 0. 

The 'V line is used 10 enable .1 7 4is:5l eighl-bil muliiplexer ai locaiion 1114 This multi- 
plexer, when enabled, connects one of its eighl input lines to ihe high order bit Ihu 7i of ihe 
three-stale system data bus. The bottom three address lines control which of the eight inputs the 
muliiplexer chooses. Four of the mux's inputs come from u 553 quad timer ai location H13 
The inputs to this timer :ire the game controller pins on ihe Game I/O connector. Three other 
inputs lo the muliiplexer come from Ihe single-oil (pushbutton) inpuis on the Game I/O connec- 
tor. The last multiplexer inpul comes Irom a 741 operational amplifier ji location K 1 3 The 
input to this op amp comes from the casscilc Input jack. 

I tic 7" line from Ihe I/O selector resi IS ill four timers in the 553 quad timer at locaiion HIS. 
The four inputs to this timer come from an RC network made up of four 0.022/1 F capacitors. 
four 100 Ohm resistors, and ihe variable resistors in the game controllers attached lo the Game 
I/O connectoi The total resistance In each o( the four timing circuits determines ihe timing 
characteristics of that circuit. 



"USER 1" JUMPER 



There is an unlabeled pair of snider pads on the \pple board, to ihe lefl of slot 0, culled [he 
"User I" jumper. This jumper is illustrated in Photo 8. If you connect a wire between these IWO 
pads, then the USER I line on each peripheral connectors becomes a ctive. If any peri 1 
pulls this line low, oil internal I/O decoding is disabled The I/O SELECT and ihe 1)1 \ It I: 
SELECT lines all go high and will remain high while USER I is low. regardless of Ihe address on 
ihe address bus. 



The USER 1 Jumper 




Photo 8. The USER I Jumper. 



99 



THE GAME I/O CONNECTOR 



+ 5v 


J o 


16 


NC 


PB0 


2 


IS 


AN0 


PBI 


3 


N 


AM 


PB2 


V 


13 


AN2 


C040 STROBE 


5 


12 


A N 3 


GC0 


6 


II 


GC3 


GC2 


7 


to 


GC1 


Cnd 


8 


y 


NC 



Figure 16. 
(tame I/O Connector Pinouls 



Table 29: Game I/O Connector Signal Descriptions 



Pin 



Name: 



Description: 



2-4 



C040 STROBL 



6.7,10.11 GC0-GC3 



12-15 



9.16 



+ 5v +5 volt power supply. Total current drain on this pin must be 

less than 100mA. 

PB0-PB2 Single-bit (Pushbutton) inputs. These are standard 74LS series 

TTL inputs. 

\ general-purpose strobe. This line, normally high, goes low 
during *0 of a read or write cycle to any address from SC040 
through SCB4F This is a standard 74LS TTL output. 

Game controller inputs. These should each be connected 
through a 150K Ohm variable resistor to +5v. 

Gnd System electrical ground, 

AN0-AN3 Annunciator outputs. These are standard 74LS series TTL out- 

puts and must be buffered if used to drive other than TTL 
inputs 

NC No internal connection. 



THE KEYBOARD 



The Apple's built-in keyboard is built around a MM5740 monolithic keyboard decoder ROM 
The inputs to this ROM. on pins 4 through 12 and 22 through 31, are connected to the matn\ oi 
rflches on the keyboard. The outputs of this ROM are buffered by a 7404 and are connected 
to the Apple's Keyboard Connector 'see below > 

The keyboard decoder rapidly scans through the array of keys on the keyboard, looking for one 
which is pressed This scanning action is controlled by the free-running oscillator made up of 
three sections d! a 7400 at keyboard location U4. The speed of this oscillation is controlled by 
C6. R6. and R7 on the keyboard's printed-circuit board. 



100 




Figure 17. Schematic of l he Apple keyboard 



101 



The 1RKPTI key on Ihe keyboard is eonnecied to ;t 555 timer eiicuii al board location U3 on 'he 
keyboard, This chip and the capacitor and ihree resistors around il generate ihe I0H* "Ki- i'eaT" 
signal If the 220K Ohm resistor K.I is replaced with a resistor of a lower value, then the IRKP TJ 
kej will repeat characters at a taster rate 

See Figure 17 for a schematic diagram of the Apple Keyboard 



KEYBOARD CONNECTOR 



The data from the Apple's keyboard goes directly to the RAM data multiplexers and latches, the 
two 741 S257s at locations B6 and H7. The STROBE line on the keyboard connector sets a 
74LS74 flip-Hop at location BIO. When the I/O selector activates its "0" line, the data which is 
on the seven inputs on the keyboard connector, and Ihe stale of the strobe flip-flop, are multi- 
plexed Onto the Apple's data bus, 



Table 30: Keyboard Connector Signal Descriptions 


Pin 


Name 


Description: 


1 


+5v 


+ 5 volt power supply. Tolul current drain on this pin must be 
less lhan 120mA. 


? 
3 


STROBE 


Strobe oulput from keyboard. This line should be given a pulse 
at least 10ms long each time a key is pressed on the keybi 
The strobe can be of either polarity 


RESET 


Microprocessor s RESET line. Normally high, ihis line should 
be pulled low when the (RESET! button is pressed. 


4,9,16 


NC 


Nn mnnectlon. 


5-7, 10-13 


Data 


Seven bil ASCII keyboard daia input. 


S 


Gnd 


System electrical ground 


15 


-I2v 


— 12 VOll power supply Keyboard should draw less lhan 
50mA. 



102 



+ 5v 


; o 


6 


STROBE 


i 


$ 


RESET 


3 


4 


NC 


4 


.f 


Data 5 


5 


i 


D.i i.i 4 


6 


/ 


Data 6 


1 





and 


H 


V 



NC 
-12v 
NC 
Data I 

Data 

Data 3 

Data 2 
NC 



Figure 18. 

keyboard Connector Pinouis 



CASSETTE INTERFACE JACKS 



The two female miniature phone jacks on (he buck of the Apple II board can connect your Apple 
lo a normal home cassette tape recorder 

Cassette Input Jack. This jack is designed to be connected to the "Earphone" or "'Monitor" 
output jacks on most tape recorders The input voltage should be I voli pcak-to-peak (nominal) 
The input impedance is I2K Ohms. 

Cassette Output .lack. Thi> jack is designed 10 be connected to the "Microphone" input Drt 
most tape recorders The output voltage is 25mv into a 100 Ohm impedance load. 



103 



POWER CONNECTOR 



This connector mates wilh the cable from the Apple Power Supply. This is an AMP #9-35028-1 
six-pin male connector. 



Table 31: Power Connector Pin Descriptions 


Pin: 


Name: 


Description: 


1.2 


Ground 


Common electrical ground for Apple board. 


} 


+ 5v 


+ 5.0 volts from power supply. An Apple wilh 48K of RAM 
and no peripherals draws —1.5 amp from this supply. 


A 


+ 12v 


+ 12.0 volts from power supply. An Apple with 48K of RAM 
and no peripherals draws — 4()0ma from this supply. 


5 


-I2v 


- 12.0 volts from power supply. An Apple with 48K of RAM 
and no peripherals draws — I2.5ma from this supply. 


" 


-5v 


— 5.0 volts from power supply. An Apple with 48K of RAM 
and no peripherals draws — O.Oma from this supply. 





i 1 










-12V 




h «1 

© ® 
P 3 4 < 

© © 

1 ' 2 1 
© 

n 




-5V 


.5V 




T 


i 


-f 12V 


GNO 






GND 









Hi: im- 19. Power Connector 



104 



SPEAKER 



5 

= 



The Apple's internal speaker is driven by half of a 74I.S74 Hip-flop through a Darlington amplifier 
circuit. The speaker connector is a Mole\ KJC100 series connector, with two square pins. .25" 
tall, on .10" centers 



Table 32: Speaker Connector Signal Descriptions 



Pin: Name Description; 



I SPKR Speaker signal. This line will deliver about .5 Wall into an 8 

Ohm load. 



5\ 



+ 5 vol i power supply. 






SPKR 

i5V 



a 



Ruure 20. Speaker Connector 



PERIPHERAL CONNECTORS 



The eight peripheral connectors along the back edge of the Apple's board are Winchester 
mm #2IIW25CO-l 1 1 50-pin PC card edge connectors with pins on .10" centers. The pin Out for these 
connectors is given in figure 21, and the signal descriptions are given on the following pages. 



105 





?fi 


O 


25 




GND 


H 


~j 


T-5V 


DMA IN 


27 


tq 


p 


24 


DMA OUT 


INT IN 


28 


[~ 


n 


23 


INT OUT 


NMI 


29 


cz 


13 


22 


DMA 


IRQ 


30 


c= 


=i 


21 


RDY 


RES 


31 


r 


-j 


20 


I/O STROBE 


INH 


32 


c= 


~3 


»9 


N.C. 


-12V 


33 


1= 


CD 


'8 


R/W 


-5V 


34 


d 


ID 


J? 


A15 


N.C 


35 


l~ 


LJ 


16 


A14 


7M 


36 


c: 


=] 


15 


A13 


03 


37 


c: 


^ 


M 


A12 


M 


38 


c: 


^ 


13 


All 


USER 1 


39 


c= 


U 


12 


AiO 


*o 


40 


l_ 


-J 


M 


A9 


DEVICE SELECT 


47 


cr 


=1 


)0 


AS 


D7 


42 


a 


ID 


9 


A.' 


D8 


43 


c 


=] 


■3 


A6 


05 


44 


, 


. 1 


J 


AS 


D4 


45 


tz 


=3 


6 


A4 


D3 


46 


1= 


=1 


5 


A.. 


02 


47 


c= 


■3 


•• 


■v; 


0: 


48 


I 




3 


A1 


DO 


4i 


r~ 


~] 


2 


AO 


t!2V 


50 


c 


D 


I 


I/O SELECT 




o 





Figure 21. Peripheral C'onneclor Pinnul 



H». 



1 



Pin 



24 



25 



26 



Table 33: Peripheral ( .mm-chii Siunal Description 
Name; Descripiion: 



2-17 A0-A15 



18 R/W 



19 Si St 



20 f70 STROBE 



21 ROY 



22 DMA 



23 INT 01 1 



DMA "I I 



+5* 



This line, normally high, will become low when 
the m "<>r references page SC«, where 

a is the individual slot number This signal 
becomes active during «l»0 and will drive 10 
LSTTI loads' l"his nol preseni on 

peripheral connecior 0. 



The buffered address bus. 
; hoc lines becomes v;ilid 
remains valid through "M 
each drive 5 LSTTL loads*. 



11k- address on 

during <l>l and 
These lines will 



<i.\D 



Buffered Read/Write signal This becomes 

valid al Ihc same ume ihe address DUS 

and goes high during a read cycle and low dur- 
um a wrile This line can drive up lo 2 LSTTL 

loads' 

On peripheral connector 7 only, this pin is con- 
nected to the viden timing generator's s 1 N< 
signal. 

This line goes low during *• when the address 
bus contains an address between SC84W and 
SCII F This line will drive 4 LSTTL loads" 

Ihe 6502's RDY input. Pulling this line low 
during <1>1 will halt the microprocessor, with the 
address bus holding the oddress of the current 

location being fetched. 

Pulling this line low disables the b502's address 
hti> and halts ihe microprocessor, This line is 
held high by a 3KU resistor to +Sv 

Daisy-chained interrupt output to lovser priority 

devices Oils pin is usuall) connected to pin 28 

(INT IN' 

Daisy-chained DMA output to lower priority 

devices This pin is usually connected 10 pin 22 
(DMA EN) 

+ 5 voll power supply. 500mA current is avail- 
able Cor (///peripheral cards. 

System electrical ground. 



Loading limns ue for cuiti ociipHcr.il curd 



107 





Tabic 33 (cont'd) 


Peripheral Connector Signal Description 


Pin: 


Name: 


Description; 


27 


DMA IN 


Daisy -chained DMA input from higher priority 
devices. Usually connected lo pin 24 (DMA 
OUT). 


26 


INI IN 


Daisy-chained interrupt input from higher 
priority devices. Usually connected to pin 23 
(INT OUT). 


29 


NMl 


Non-Maskable Interrupt. When this line is 
pulled low the Apple begins an interrupt cycle 
and jumps to the interrupt handling routine at 
location S3FB. 


30 


IRQ 


Interrupt ReQucsi. When this line is pulled 
low the Apple begins an interrupt cycle only if 
the 6502's I (Interrupt disable* flag is noi sei 
If so. the 6502 will jump to the interrupt han- 
dling subroutine whose address is stored in 
locations S3FE and S3FF. 


31 


RES 


When this line is pulled low the microprocessor 
begins a RESET cycle (see page 36). 


32 


fNH 


When (his line is pulled low, all ROMs on the 
Apple board are disubled. This line is held high 
by a 3K 11 resistor lo +5v. 


33 


-12v 


-12 voli power supply. Maxmum current is 
200mA for all peripheral boards. 


34 


-5v 


—5 volt power supply. Maximum current is 
200mA for all peripheral boards. 


35 


COLOR REF 


On peripheral connector 7 only, this pin is con- 
nected to ihc 3.5MHz COLOR RLFerence sig- 
nal of the video gcneralor. 


36 


7M 


7MHz clock. This line will drive 2 LSTTL 
loads". 


37 


Q3 


2MHz asymmetrical clock. This line will drive 
2 LSTTL loads". 


38 


■M 


Microprocessor's phase one clock. This line 
will drive 2 LSTTL loads* 


39 


USER 1 


This line, when pulled low, disables all internal 
I/O address decoding" 



Loading Umiu arc for udi peripheral card 
Sec page 99. 



I OS 





Tahli-.U (cnnfd): 


1'i-riphi-rul timni'iior Signal Description 


Pin: 


Name: 


Description: 


40 


*0 


Microprocessor's phase zero clock. This line 
will drive 2 LSTTL loads*. 


41 


Dl-VK 1 


This line becomes acitvc (low) on each peri- 




SI IK 1 


pheral connector when the address bus is hold- 
ing an address between SC0/10 and SC0*jF. 
where » is the slot number plus S8. This line 
will drive 10 LSTTL loads*. 


42-49 


D0-D7 


Buffered bidirectional data bus. The data on 
this line becomes valid 300nS into <l>0 on a 
write cycle, and should be stable no less than 
100ns before the end of O>0 on a reud cycle. 
Each data line can drive one LSTTL load. 


50 


+ I2v 


+ 12 volt power supply. This can supply up lo 
250mA total for all peripheral cards. 



Loading limn* utc for each periphci.il i-mi 



109 












■ 



- 






: i 






j»--"i 






I rtgnre 22-1. Schematic Diagram nf the Apple II 



ii i hi 



,, -•■■■-■■■ 




- \ '•"- 



FiRure 22-2. Schcmalic Diagram of Ihe Apple Ii 



111 




Figure 22-3. Schemalic Diagram of the Apple II 



112 




Figure 22-4. Schematic Diagram of the Apple 



113 




Figure 22-5. Schematic Diaer&m of the Apple II 



114 




Kigurt- 22-6. Schematic Diagram of I lie Apple II 



115 



ft 

E 



116 



? 

c 




u 



u 



117 






6502 MICROPROCESSOR INSTRUCTIONS 



ADC 


—arii in *-ctini(iati)i xiin 


LOA 




Car., 


LOX 


AND 


"AMD Memory ■>!>• Accumulator 


LOV 


ASl 


5hl". Le'l On* B'l >Mo«iary 01 

ActumuuIO'' 


LSB 


■cc 


Brand o» Ca", deei 


HOP 


acs 


Biinr" u*» C*»y 5*1 


ORA 


BEO 


B(»n(<i o« 1pn.il ;»- L - 


PNA 


BIT 


Tm B'll m Mammy witn 




*«UOgl|tOi 


PMP 


BUI 


Qtoncn on Ration M<nut 


PL A 


6NE 


Bianch on R«un not 2*io 


PLP 


BPL 


Branch on Remit Piu* 


ROL 


BRK 


Force. Braat 




BVC 


Branch on 0«"''ln» Of »' 


ROR 


BVS 


Biencn On OvrrtKiv. Sal 




CLC 


Ota' Carry 'lag 


ATI 


CLD 


CHiai Oec.mai MOW 


RTS 


CLI 


CM»*I Inlei'uol □ 


SBC 


CLV 


Or at 0«B>rioi* Flag 




CMP 


Compete Memory ana Accumulate* 


SEC 


CPX 


Ccth'- Memory ana iiioe« * 


BED 


CPY 


Compa'e Mp">ci> anO Indea v 


HI 


DEC 


D»f. ■c-nrnt Memory By One 


STA 


DEX 


Dfrcement InOei X by On* 


STK 


OEV 


Deoement ingot * r>y One 


STY 


eon 


-Of" Memory win 


TAX 




Accumulate 


TAT 


INC 


incrrmenl "tmo-y b? On* 


TSX 
TXA 


INK 


inciamenl InrMa X by On* 


IN» 


increment Indc* V P. On* 


TXS 
TVA 


JMP 


Jump (a N*» i :n ' 


tin 


Jump to N«» LOCII'D" Sactng 





hW i ■ • v-'; 



LOCO »«uiii.'«(oi -tin Memory 

Load |n«i«« X Mir Mcmary 

1.0*0 l«a*" * *tlp Memury 

S'*-" nijrrt one Bit Mtimory o' 

Accumulator 1 

No Operatic 

"OR ' Memory ■"in Accumu-el'v 

Pu»« Accun-wialot on Slat « 
Pu«h C»DCM.oi Slat m on Staci 
Pull Accumulaloi trom Slack 
Puii Piocoiio' Staiui t'om Siac* 
Rotate One Btl Lett 'Memory or 
Accumulator! 

Hutale On* Hi Right <M*rnory O' 
ACCumuUtOT' 

fWyrn (roni mtanupi 

Return liom Subtuutine 

3ubtracl Memory 'mm Accumulator 

■ Ith P.I i 'i" - 

S*l Cany Flag 
Sei D*c<m*i Mocte 
Sel inwrruci Dnabi* Stain* 
Store Accumulate" in Memory 
5lo<e inOet X in Memory 
Slaie inOei * in Memory 
TlMttgi Accum u ifio> to ind«* X 
T»*n»i*r Accumulator lo indei * 
Tr*n«t*r Slack Pcmier lo Indei X 
Tian»1*» Inoei X to Accumulator 
Tianttet Inaei X lo 5t*"> I 
1 rentier |ng«i » to Accumulaloi 



J 

m 

e 

- 
e 

el 






118 



t* 

" 



THE FOLLOWING NOTATION 
APPLIES TO THIS SUMMARY: 



PC 

PCM 
PCI 
OPtK 



»c nun .1 not 

IritMa 1*Tjiiti<i 

Minor) 
■arrow 

P'oiaiior Statu. Ragnn» 

Slack ' ■ ■"■*< 

Cnanga 

No Cl-ianga 

A« 

loo-cal AND 

Subtract 

logical fir'ui«« Or 

Tr»"i'»* *iom Slack 

TftMalW To 5UC« 

Tran»>*r To 

'»--.'■' To 

Logical OR 

Piog'am Counter- 

PiOO'im Counta' Mtgft 

Program Count*' Low 

1 .i[if'n' : 

immaddla Add'auing Mo<M 



Figure i asl-shift left one bit opeoakon 


c — { ? 1 « 1 s 1 « 


? 


i 


,|. 


h° 


FIGURE? ROTATE ONE BIT IE" iMEMORV 
Oft ACCUMUl"TOfl> 


WO" A 




L- r 


t 


s 


' 


i 


? 


' 





_]- 


c -J 


hgure a 




Lnn- 




- 


* 


i 


•h 


J 


1 


: - 



NOTE 1 BtT - TC5I BITS 



Bi 6 and 7 ■<■ iTanilai-Bd lo 1Kb ataiu* <ag>aiB' » turn 
rai.ni of A AM nirro than Z'l. otnat*i»e iVQ 



119 



PROGRAMMING MODEL 


















A 

















V 


I 















X 


1 


15 











PCM 




PCL 


: 















1 0I 1 


S 





ACCUMULATOR 



INDEX REGISTER V 



,..; ( . -i r,|.-rn . 



STACK POINTER 



N V B D I Z C 



: 



PROCESSOR STATUS REGISTER P 



CARRY 

ZERO 

INTERRUPT DISABLE 

DECIMAL MODE 

BREAK COMMAND 

OVERFLOW 

NEGATIVE 



120 



INSTRUCTION CODES 






■ irnt 

DauilplhMi 


Cn-ifon 


Afj-j-ntutg 


luimtli 
F»fi" 


ntt 

or 

CU- 


ant 

0,1.1 


•7CI0V 


ADC 

AOO mfmwy Id 

i: ■ ■■t'.ilillOt ■*tll> tJi'l 


ft M-C -AC 


hMMdato 
?no Pagr 
Zero Page 1 
AKohjlf 

*«OIl,U 1 

Acwiute V 
(iitfirccUl 

.1-,.!. ,-.-!■ 1 


UN ■Opt) 
ADC Opei 

AOC Open 
ADC Opei 
ADC Opei.X 
ADC Dpi) ' 
ADC iDor U 
AOC lOpe-IY 


BS 

60 
7D 

n 
n 


2 
2 

3 

3 
3 
Z 

2 


\ v v \ 


ANO 

AND" memo'* with 

acttmuijio' 


MM -a 


ImmtOiale »^0 »Opet 
Zero Papf AND Oper 
ivaHQr.t AND OperX 
Autoluie [ AMD Op*' 
AMotui* X , ANO Qper 1 
AbMWe * , AND Opei V 
<lnt!ira:i XI AND lOptf.X) 
(Insiiecli » 1 AND (Opei)Y 


» 

JS 

70 

30 
39 
Zl 
31 


Z 
2 
2 
3 
3 
3 
Z 
Z 


■A 


ASL 

Shift tell one bil 
(Memory 0' Accumulator! 


iSe* Figure t> 


Aecumuiaioi 
Zero Pace 
Zero Page X 
MnoiuM 
AtnoHiie X 


*Sl A 
ASL Opei 
ASL Opal X 
ASl Opei 
ASL Oot'X 


OA 
06 

16 
Of 

IE 


1 
Z 
2 
3 
3 


v\rV 


BCC 

Bunch on tmy clear 


Branch on C-0 


RiMni 


BCC OP'i 


BO 


1 




BCS 

Branch on catrv Ml 


Bianch on C= 1 


RtJatM 


BCS Opal 


Bi 


2 




I'i.-.i' ■■ rr-,i.i' :ti: 


Bianch on * 1 


Hi" .11 V- 


BEO Opei 


FC 


2 




BIT 

I«1 Dili in memory 

• It) «Cil "■ ■■' ■ 


»«M U, — N 
M.-V 


/ero Page 

ADsWute 


BK- Oper 

[III* LI;:-. 


X 


7 
3 


■V "** 


BMI 

Bunch on rwjli nxnus 


Branch nn h i 


nuatiM 


BMI Opei 


30 


2 




BME 

Bund on result nol itio 


Branch on 2-0 


Relative 


■!M QDC 


00 


2 




BPl 

Br incn On 'Mull D>ui 


Branch on N-0 


Hrl.h.r 


BPi ope- 


10 


2 




BHK 
Fflrct BiMk 


FOrcrt 

Inlerrupi 

PC-ZIP* 


|*pM 


BHK' 


00 


1 





BVC 

Br JnCli 0(< OltrHOo Cllll 


■i .ii El M * I-' 1 


Berairve 


BVC Opei 


u 


Z 










M . ■ 


-- f 


•-» . •-»< 


i. — ■ w e. .-> ■* 



k. ..—__ r 



121 



Km 


DnnMHi 


— 

l-m.il n D 
Modi 


»ii|i»l» 

ling.tgt 
Fin 


-LI 

OP 
Cadi 


Ha 
turn 


P •■■■!• ..1 Htg 
MI CI V 


BVS 


■ 'i on V 1 

-— c 


huim 


.-.,, ..!■ 


70 


7 




CLC 

C ',v tax, fijj 


■,nii. pi! 


CLC 


11 


1 


0- 


CLE 

Cleat decimal modi 


0*0 


■ 


ClD 


01 


1 


-0- 


CLI 


0—1 


Impliefl 


Cll 


» 


T 


-0 


CLV 

Qui ci.fi'io* iijg 


0— V 


Imprieo 




Bl 


I 





CMP 

Compare memotY and 
accumulate' 


A -M 


itnmediaie 
Zero Pafje 
/(■to rage X 
Absolute 
APsolule X 
Aoioluie * 
- , • , 

■ ■ 


1 MP :-■,-, 

CMP Opei 
CMP OperX 
CMP Ope 
CMP Oper t 
CMP OoetY 
CMP (Opei XI 
CUP (OpeilV 


C8 
CS 
Ob 
CO 
DO 
H 
CI 
01 


? 

7 
7 
3 
3 
3 
7 
7 


vV* 


CPX 

Compare memory and 
indet X 


K-M 


Immediate 
Ztio Pag* 
Aowiiun 


CPX -Oper 
CPX Opei 
CPI Opet 


EC 
f« 

EC 


? 
2 

3 


tfVtl 


cpr 

Compile memory and 
i-idei V 


V — M 


ImmaOtalr 
/no Page 

i:,,,.i,.|. 


CPY 'Oot' 
CPT Oper 
CPr Oner 


CO 
C4 
CC 


1 
7 

3 


vw 


OEC 

Decemenl memory 

By one 


H - 1 — M 


7eio Pag* 

/eto Page 1 

IibMkni 

Alv.n mr i 


OEC Opei 
DEC Opei * 
01 C Opei 

ok ;:■;-■ ' 


C6 
06 
CE 
OE 


7 

7 
3 

3 


•v 


DEX 

Oeiremen 
tty on* 


H-1-* 


implied 


DEX 


CA 


1 


</•,- 


DEY 

Oecremeni mdei y 

0, 0<H 


V - 1— * 


Implied 


DEV 


■ 


1 


A 



122 






= 

- 



55 
55 



ftjIN 

uiicfiiiipfl 


OfltrMtm 


MM 


AiiimBli 

LUPJMH 
Fm 


OP 
cm 

49 
45 
55 
40 
50 
59 
41 
51 


•M 
G,w 

2 
2 

? 

3 
3 
3 
2 

i 


P Si»-ut »ib 
■ I C 1 H 1 


iOfl 
Eacmohvi 0' "!«(!«<¥ 

Willi MCUWullCor 


* v y -a 


iftsntdiW 
luc Pagr 
c"rtn Papa X 
Abwlulf 
AMollltl ' 
Aosolutl V 
(indi'KI.I) 

n-l.-.t, V 


EW ■0p«' 
FW Optr 

ton on*'* 
ton Oar- 
rofl 0p«t i 
EOR Oppt » 
EOR <0p«(.Xi 


INC 

l*ti emot metnoiy 
Dy ant 


M • 1 -M 


.''■- page 
Zero Pagt X 
AMolulF 

AEMlUtf x 


INC Opel 

m djmi 1 

IK Dp*- 
IK Opc'.X 


Eft 

F6 
EE 
FE 


7 

7 
3 

3 


'. « ■ 


INK 

toenmenl mdti X B» on» 


X-1-X 


imnlifC 
Impliod 


INK 


EB 


t 


•. 1 


INY 

M BMW '"->■ 1 bt .i i 


y.i— v 


(NV 


ca 


1 


A 


JWP 

Jump 10 nf » location 


ipc.«i -pa 

|PC-?I — PC 


*Mdui» 
Indirect 


J HP Op*r 
JUP iDpct 


4C 

K 


3 

a 




JSR 

Jump to ne« location 

saving (Mum idOteu 


PC?( 

IPC-11 -PCl 
IPt-71 — PCH 


-v : ..-, 


JSR Opei 


70 


a 




uu 

Load iccumwlato' 
with mcmo>y 


M— A 


immediitf 
Z«to Page 
Zero Pago * 
AOiolutt 

ABSOlt I* X 

Atnolult V 
(IndiittlXi 


IDA «Oper 
IDA Ope 
LOA Opf'.l 
LOA Opt' 
IDA Opc.ll 
IDA Opf.V 
IDA |0pe<X| 
IDA lOprn Y 


AS 

A5 

B5 
AD 
flD 
B9 
Al 
Bl 


2 

a 
? 

3 
3 
3 
2 

7 


A 


LDX 

Load 'no*i I 

■ ith mofioty 


M -X 


lmm*iMti 
Itm Pas* 
Zt"o Paof ' 
A&*o»uie 

AE-ii ..-' i 


IDX •Op«r 
LDX Opt. 
iDx Opei i 
LDX Opei 


A? 
Aft 

B6 
A£ 

BE 


7 
2 

7 
3 
3 


VJ 


LDY 

Load inflii » 
■ itn memory 


M— V 


Immadiaie 
li'o Pag* 
Ztt o Page X 

Atoiiiuie 
AblBtutr X 


LDY «0pti 
LOT Opi> 
LOT Otw.l 
LD* Opt* 
ID' DoeiX 


AO 
A4 
64 
AC 
BC 


2 

2 
2 

3 

3 


«M 



123 



Dries':-- 


0H"«on 


'SOfimng 
Mad* 


•u.mtli 

Ijngutg* 

fira 


HCK 

OP 
Cost 


Hi 

n.iM 


p Hi in i *»a 
KICIOV 


LSR 

Sfttt ngM one dm 
imcmoii o( accumulator) 


|Sh Rgn II 


Accumulator 
Zero Page 
7ero Pag* .» 
AMolute 

/•:■-, .ij'i- ' 


LSI A 
L5R Ope' 
L5R Optf.K 
15R Ope' 
ISH Optf.X 


56 

«I 

St 


i 

2 
7 

3 
3 


NOP 

No operation 


V Hn-riMM 


Implied 


NOP 


EA 


1 




ou 

0« m*mo<y •til* 
at cumuli lot 


AVM-A 


i ■. -if !■!'■ 

7t-o Page 

Zero Page X 

AOsoluW 

Aowkite.X 

ADaolule.Y 

(tnflneclXl 

1 Indited) Y 


ORA eOrxr 
ORA Op" 
ORA Opet.X 

ORA Oper X 
ORA Ope-.Y 
ORA (Opef X> 


oa 

05 
15 

00 
10 
19 

Of 
11 


2 

7 
2 
3 
3 
3 
2 
2 




PHA 

9\nh accumulator 

.11' -.m:« 


M 


implied 


PHA 


*e 


' 





PHP 

Puiit prot»»a' statu* 


Pt 


Implied 


PHP 


oe 


1 




PUL 

Pull acrumniiipi 

trom Hack 


At 


r-[ iiT 


PLA 


u 


1 


* 


PLP 

Pull p-oceiim itatu* 
•rom Hack 


P* 


impiiefl 


PIP 


7t 


■ 


from Slae* 


ROL 

Rotate one r*t left 

(memor, 0( accumulate! 


(See Figuie ?i 


Accumulate)' 
Zero Page 
Zero Page 11 
Absolute 
Altwiutr x 


ROl A 
ROL Opt' 
ROL Oper.X 

ROL OlT 

ROl Optr ' 


2A 

» 
» 

a 

3E 


2 
3 

3 

3 


%W 


ROR 

Rotate one DiT ngnt 
imemo<i m accumulator! 


|5«e fiove 3) 


Accumulator 
;.r Ragi 
Zero Page x 
Absolute 
Atnoiuie l 


ROR A 
ROR Oper 
ROR Oper* 
ROR Opet 
ROR Opef 1 


6» 
66 
'6 
BE 

7E 


t 
J 
2 

3 
3 


VV*' — 



24 



P 



feat 

Out'lfiDM 


Operant* 


*ri)iftii»c, 
Maoi 


lueSi. 

Li"Uiiigi 

Ftae 


m 

OF Me 


r Suiui Htt 

■;cib« 


HTI 

*«1,l'-l liiVH i Tttp,ipl 


' ' 


li-i^lKO 


HTI 


* 


, 


f'om Star- 


RTS 

Return iiorn subroutine 


.--. .-,- ■ _i : 


Implied 


RTS 


go 


1 




SBC 

Subtract WW, liom 
« cumulate *itn DCimc* 


» M - C —A 


Immediate 
Zero Pa at 
Zero Page « 

Amoijtr 
Absolute I 
Absolute V 

"iinen I: 
'",•,. -. : n y 


SBC 'Optr 
SBC Optr 
SBC Ope.* 
SBC Op« 
SBC Opei.X 
SBC Opt' V 
SBC lOpf.l) 
SBC lOpeO • 


E9 

(5 

FS 

ED 
FD 
F9 
E1 
FT 


3 
7 
3 
3 
3 

a 

3 
3 


»/*A t 


SEC 

■■ .1 ■, Rag 


1 -1 


Implied 


Str 


31 


1 


— i — 


SED 

Sal H iHl mode 


■ -0 


ir- r in> 


SED 


F8 


i 


, 


SEI 

Set mlr rrupt disable 

STalll* 


I— 1 


implied 


SEI 


a 


I 


' 


STA 

Sioie accumulate! 

in memo 1 * 


A — H 


;*io Page 
it'ii Pa 3" i 
Absolult 
Absolute X 
Absolute* 
ltndi'«i.» 
, i ■ -ev ■ 


STA Optr 
STA Optr X 
SIA Dptr 
STA Opar.X 
STA Opcr.V 
STA (Opt'. X) 
STA IDpei).* 


■ 

SO 
BO 
99 

at 

91 


1 
2 
3 
3 
3 
2 
2 


STX 

S'Dir mod X i" memory 


X — M 


ZfO Page 
?e>o •'ao.e * 
Absolute 


STX Opt' 
5TX Opci.V 
SIX Optr 


M 
96 
BE 


3 
? 
3 


- 


STY 

Store mOti V in memory 


v — m 


ttia Page 
Itio Pact X 
Absolute 


STY Optr 
STY OpC'.X 
STY Opti 


H 

9* 

K 


2 

? 
3 


-- 


1AX 

trifti'ti accumulator 

io indo I 


A— X 


l T( nl-,' 


TAX 


AA 


t 


%V 


W 

Transit' accumulator 
la indti • 


a— y 


Implied 


IAY 


AB 


I 


vV- 


TSX 

fltnUtl slat' poinlti 

ID tnoe . ■ 


S-X 


iv ; ..-.- 


TSX 


BA 


1 


sA 



125 



DwlpltM 




ABO' mlnf 
Mew 


AiumDi, 

Lingutg* 

Fata 


HEl 
DP 
CMf 


No 

E.IM 


mcim 


txa 

it leeufnaliU 


* —A 


IntDltM 


I»A 


hi 


1 


s ■. 


TXS 

lr*mta iriMi »'d 

SUM po«nlt> 


I -S 


Implitd 


1X5 


*» 


I 




TYA 

■ 


V -A 


ImpliM 


rvA 


W 


1 


vv— 



126 



HEX OPERATION CODES 



00 - 


brk 




3f - NOP 




SE - 


- LSR - 


A 0*3* nip 11 


D1 - 


ORA 


- -itO-ieCI. X* 


30 - 8MI 




sr - 


■ NOP 




n 


NOP 




11 - «ND 


- Ona-iecn. * 


H 


RTS 




03 


NOP 




33 - NOP 




Bl 


ADC - 


- Indirect. Mi 


:.t - 


NOP 




a - nop 




63 - 


NOP 




OS 


ORA 


- Zeio Page 


34 - NOP 




■3 


NOP 




-- 


ASl - 


■ Zero Pan* 


35 — AND - 


- Zero Page « 


64 - 


NOP 




07 - 


NOP 




36- ROL 


■ Z*'o Page, a 


09 • 


■ ADC - 


- Zero Page 


H - 


PHP 




ST - NOP 




66- 


- ROR - 


- Zero Page 


DO 


ORA - 


- immediate 


311 ■ SEC 






NOP 




OA - 


ASl - 


- Accumulator 


M- ANO- 


- AMoiute. » 


M - 


PLA 




Of 


NOP 




3A - NOP 






ADC 


- im menial* 


X - 
DO - 


NOP 
- ORA - 


- *L1.- „l* 


IB - NOP 
3C- NOP 




6A- 

H - 


- ROR - 

- NOP 


- Accumulate' 


H 


ASl 


Ao»olo1* 


3D - AND - 


"■: >|UM ' 


> C 


- JMP 


- indirect 


Of 


NOP 




3E - ROL - 


AMoiuie 1 


60- 


- ADC ■ 


K\—.\ ulr 


n - 
it — 


BPV 

ORA - 


- undirKU V 


« - NOP 
40- BTl 




M 

-. . 


ROR - 
NOP 


IWHMI 


12 - 


NOP 




41 - EOR - 


- (Indirect. »' 


ra - 


BVS 




13 - 

14 — 


NOP 
NOP 




42 - NOP 

43 NOP 




71 - 
72- 


ADC - 
NOP 


- Ilndirecll Y 


15- 


ORA - 


- Z*o Pag* II 


44 - NOP 




73- 


NOP 




16 — 


ASl - 


Zero Pag* • 


45 - EOR - 


Zero 1 tga 


7* - 


NOP 




1* 

16 — 
It — 


NOP 
CIC 
ORA- 


fUuoiuta ■ 


46 - LSR - 

4T — NOP 
a - PHA 


Earn Page. 


li 

7.. 

n - 


ADC - 
ROR - 
NOP 


- .'em Page X 

- Zero Page X 


IA- 


NOP 




40 - EOR - 


- Immechaie 


n - 


SEI 




1B - 


NOP 




4A - LSR - 


Accumulator 


■■- 


ADC - 


- Abtfiuia * 


IC - 


NOP 




4B - NOP 




;a - 


NOP 




iD - 


OHA - 


- AbfOlule 1 


4C - JMP - 


■ Acolule 


7B 


NOP 




IE - 


ASl - 


AD«0!ul* X 


4D - (OR - 


- A0*0I U W 


ro 


NOP 




« - 


NOP 




4E - LSR - 


AbMituie 


7D - 


ADC - 


- AOtolule X NOP 


K - 
21 — 


J5R 
AND - 


- i%i.i«i' Mi 


4F— NOP 

50 - BVC 




TE - 

?r - 


ROR - 
NOP 


- ADaotute ■ NOP 


33- 


NOP 




51 — EOR i Indirect* « 


B0 - 


NOP 




33- 


NOP 




53 - NOP 




Bl - 


8TA - 


i Indued X< 


24 — 


BiT — 


Zero Page 


51- NOP 




-.' 


NOP 




IS 


AND - 


- 2e«o Pege 


54 - NOP 




u - 


NOP 




.' 


ROl - 


- Zero Page 


55 - EOR - 


- 2a ro Page. X 


B4 


-STY - 


■ Zero Page 


27- 


NOP 




56 - LSR - 


- *<-"i Page ■ 


•g - 


STA - 


Zero Paga 


VI- 


PlP 

AND - 


- immaOiala 


57— NOP 
SB - Cll 




B7 - 


srx- 

NOP 


/■ro Page 


SA - 


ROl - 


- Accumulator 


16 - LOR 


- Abiolute. V 


aa- 


OEV 




28- 


NOP 




5A - NOP 




69- 


NOP 




K 


BIT - 


Abaoiuia 


5B - NOP 




BA 


TXA 




n 


AND - 


- Aoeoiute 


5C -NOP 




SB - 


■ NOP 




26 - 


ROl - 


- AUaoiuia 


50 - EOR - 


- •Moluta I 


i<: 


ST* - 


AWOlula 



127 






»0 - STA - 


Ano'uIV 


0* - LOV - 


Jt- ■ i j.j" ■ 


DB -NOP 




at - six - 


* r ■..■! i'r 


Bi LOA - 


■ *i: Page x 


DC -NOP 




■F - NOP 




B6 lO» • 


.' 1- ■ ■ 1 ag< i 


DD -CMP 


- Abioiuie X 


90 - acc 




87- NOP 




DE - DEC 


AM lift ■ 


91 ST* 


iiftc.««i' y 


B0- CLV 




OF - NOP 




W - NC 




B9 - LOA - 


'' ■- . u- • 


EO - CP» - 


- immediate 


93- NOP 




BA - TEX 




Et - SBC- 


i' : rr.l " 


9* - ST* 


luto Pag* x 


BB - NOP 




a- nop 




0!, - 5TA - 


- Zero Page * 


BC -LOV - 


Atmilut* X 


E3 - NOP 




96 - ST* - 


Zwo Page. Y 


BO - LDA - 


AbBOtule X 


E4 - CPX - 


- Zvio Page 


97 - NOP 




BE - LDX - 


Absolute V 


El - SBC 


- Ze'O Page 


9S - TV* 




BF - NOP 




Efi - INC - 


Zeio Page 


99 - STA - 


- AOnXuie r 


CO - CP» 


immediate 


E7 - NOP 




9A - rxs 




Ct - CMP 


- 'Imuran X' 


El - INK 




90 — NOP 




CI - NOP 




E9 - SBC - 


- immediate 


«C - NOP 




C3 - NOP 




EA - NOP 




90 - STA - 


*B*aHj1« « 


C4 — CPV - 


- 2eio Page 


EB - NOP 




« - NOP 




C5 - CMP - 


- Ze'o Pag* 


EC - CPX 


- Absolute 


BF - NOP 




C6 - DEC - 


- Zcio Page 


EO - SBC - 


- Absolute 


AO — tor - 


- immediate 


cr - nop 




EE - INC - 


Abaoiuta 


A1 - LDA - 


- ilnfttrtct, *" 


CB - INY 




EF - NOP 




At - LOR - 


■ immediate 


C» - CMP - 


- Immediate 


FO - BEO 




A3- NOP 




CA -DO 




Ft - SBC - 


- iinAneo, i 


A* - LDY - 


Xmia Pan* 


CB - NOP 




F? — NOP 




AS - LOA - 


?e-o P*Q» 


CC - CPV - 


Apiolule 


f 3 — NOP 




AE - LDX - 


Zna Pag« 


CD -CMP - 


- Abtoluie 


ft - NOP 




A7 - NOP 




CE - DEC - 


- Absolute 


FS SBC - 


/■tu P*g« X 


A6 - TAV 




CF - NOP 




f 6 - INC - 


Zeio Pag*. X 


A9 LDA - 


Immediate 


00 - BNE 




F7 — NOP 




AA - ' * ■ 




01 - CMP 


Hodirecll V 


F6 — SED 




AB-NOP 




0? - NOP 




F9 - SBC - 


- Absolute r 


AC - LOV - 


Atiolute 


Dl - NOP 




FA - NOP 




AO — Absrxuu 


D« - NOP 




FB - NOP 




AE - LDX - 


AtKOlule 


D5 - CMP - 


- Zoio Page x 


FC -NOP 




A< - NOP 




Dfi - DEC - 


- 2e>o Page a 


FO - SBC - 


- AbaoMe. X 


BO - BCS 




or - NOP 




FE — INC - 


Absolute. X 


Bi - IDA - 


UndirecK Y 


OB - CLO 




FF - NOP 




as- nop 




OB - CMP - 


- Aoaoiuie V 






81 - NOP 




OA - NOP 









— 



128 



S 




APPENDIX . 
SPECIAL LOCATIONS 



129 



Table 1: Keyboard Special Locations 



Location: 
Hex 



Decimal 
SC000 49152 -lets-) 



Description: 



Keyboard Data 



SC0'.0 49168 -16368 Clear Keyboard Si robe 





Table 4: Video DIspUj 


Memor> Ranges 




Screen 


Page 


Begins 
Hex 


1 

Dec i mill 


Fnds at; 
Hex 


Decimal 


Text/Lo-Res 


Pnin.li> 
Secondary 


3400 
SS00 


1024 
Z048 


SBFF 


2047 
3071 


Hi-Res 


Primary 
Secondary 


S2000 
S4000 


16384 


S3I f 1 
S5FFF 


16383 

24575 







Table 5: 


Screen Soft Switches 


Local ior 
Hex 


Decimal 


Description: 


SC050 
SC051 


49232 

492 13 


-16304 
-16303 


Display a GRAPHICS mode. 

Display TEXT mode. 


SC052 

M 053 


49234 
49235 


-16302 
-163A1 


Display all TEXT or GRAPHICS. 
Mix TEXT and a GRAPHICS mode. 


SC054 

SC-055 


49236 
49237 


|l !00 

-16299 


Display the Primary page (Page 1). 
Display the Secondary page (Page 2). 


SC056 

SC057 


49238 

49239 


-16298 

-16297 


Display LO-RES GRAPHICS mode. 
Display HI-RES GRAPHICS mode. 



g 

g 

— 

S 



Table 9: Annunciator Special Locations 


Ann. 


State 


Address: 
Decimal 


Hex 





off 

on 


49240 

49241 


-16296 
-16295 


SC058 
SC059 


1 


off 
on 


49242 
49243 


16294 

-16293 


SC05A 
SC05B 


2 
3 


off 
on 


49244 
49245 


-16292 

16291 


SC05C 
SC05D 


off 

on 


49246 

49247 


I (.290 
-162K9 


SC05E 
SC05F 



130 



_ . 



Table 10: Inpul/Oulput Special Location^ 



Function 



Speaker 



Casselle Out 
Casselie In 



Annunciators 



Flag inputs 



Analog Inputs 



Analog Clear 



Uiiliiy Sitobe 



Address: 

Decimal 



Ilex 



4'> 200 



-16336 SC030 



49184 

49256 



-16352 SC020 
-16288 SC060 



49240 -16296 SC05S 
through through through 
49247 -16289 SC05F 



49249 -16287 SC061 

49250 -16286 SC062 

49251 -16285 SC063 



49252 -16284 SC064 

49253 -16283 SC065 

49254 -16282 SC066 

49255 -16281 SC067 



49264 



-16272 SC070 



4921b 



-16320 SC040 



Read/Write 



R/W 



R/W 



lahlt- II: lf\l Window Sui'cinl l.ncali«ms 



Function 



Left Edge 



Width 



Top Edge 



Bottom Edge 



Location: 
Decimal Hex 



32 



S20 



33 



S21 



34 



S22 



35 



S23 



Minimum/Normal/Maximum Value 
Decimal Ilex 



0/0/39 S0/S0/S17 



0/40/40 S0/S28/S28 



0/0/24 S0/S0/S18 



0/24/24 S0/S18/S18 



Table 12: Normal/Inverse Control Values 



Value 
Decimal 



Ilex 



Effect; 



255 



Si I 



S3 



S3 1 



127 



S7F 



COUT will display c haracters in Normal mode. 
COUT will display characters in Inverse mode. 



COUT will display letters in Flashing mode, all 
other characters in Inverse mode. 



Table 13: Autostart ROM Sprcial I ocations 



Location: 

Decimal 



Hex 



Contents: 



1010 S3F2 Soft Entry Vector. These two locations contain 

1011 S3F3 the address of the reentry point for whatever 
language is in use. Normally contai ns SE003. 



1012 S3I t Power-Up Byte. Normally contains S45. 



M36" SFB6F This is the beginning of a machine language 

(-U69) subroutine which sets up the power-up location. 



131 



Table 14: Page Three Monitor Locations 


Address: 
Decimal Hex 


Use: 

Monitor ROM Autostart ROM 


1008 S3F0 

1009 S3F1 


None. 


Holds the address 
of the subroutine 
which handles 
machine language 
"BRK" requests 
(normaly SFA59). 


1010 S3F2 

1011 S3F3 


None. 


Soft Entry Veclor, 


1012 $31-4 


None. 


Power-up hyle. 


1013 S3F5 
I0M S3F6 
1015 S3F7 


Holds a "JuMP" instruction lo the 
subroutine which handles Applesoft II 
"&" commands. Normaly S4C S58 
SFF. 


1016 S3F8 
10P S3F9 
1018 S3FA 


Holds a "JuMP" instruction to the 
subroutine which handles "User" 
dt'TRI. Y|) commands. 


1019 SUB 

1020 S3FC 

1021 S3FD 


Holds a "JuMP" instruction lo the 
subroutine which handles Non- 
Maskable Interrupts. 


1022 S3FE 

1023 S3FF 


Holds the address of the subroutine 
which handles Interrupt ReQuesis. 



— 



Table 22: Built- 


n I/O Locations 




SC000 


S0 SI S2 S3 S4 S5 S6 


S7 S8 S9 SA SB SC SD 


SE SF 


Keyboard Data Input 


SC010 


Clear Keyhoard Strobe 


SC020 


Cassette * >uipul roggle 


SC030 


Speaker Toggle 


SC040 


Utility Strobe 


SC050 


t> 


IK 


iiomu 


mix 


pri 


MC 


lores 


hlFt'S 


ti nB 


anl 


.in.' 


un3 


SC060 


tin 


pM 


I'M 


pbJ 


S rf 


gel 


p2 


IC3 


repeal SCGW-SC667 


SC«7fl 


Game Controller Strobe 



Key to abbreviations: 

gr Set GRAPHICS mode 

nomix Set all text or graphics 

pri Display primary page 

lores Display Low-Res Graphics hires Display Hi-Res Graphics 



tx Set TEXT mode 
mix Mix text and graphics 
sec Display secondary page 



an Annunciator outputs 
gc Game Controller inputs 



pb Pushbutton inputs 
tin Cassette Input 



132 




Table 23: Peripheral Card I/O Locations 



SI S2 S3 S4 S5 S6 



Inpui/Oulpul for sloi number 



S8 S9 SA SB SC SD SE SF 




Table 24: Peripheral Card PROM Locations 


SC1H 


S00 S!0 S20 S30 S40 S50 S60 S70 S80 S90 SA0 SB0 SC0 SD0 SE0 SF0 




1 


SC200 




2 


SC300 




3 


SC400 


PKOM space for sloi number 


4 


SC500 




5 


SC600 




6 


M im 




7 







Table 25: I/O Location 


Jase Addresses 






Base 








Slot 








Address 





I 


2 


3 

SC0B0 


4 

S< 0< 


5 
SC0D0 


b 


7 


SC080 


S( 0K0 


M W 


SC0A0 


SC0E0 


S( 01 


SC081 


SC081 


SC09I 


SC0A1 


SC0BI 


SC0CI 


SC0OI 


SC0E1 


SC0FI 


SC082 


SC082 


SC092 


SC0A2 


SC0B2 


SC0C2 


SC0D2 


SC0E2 


SC0F2 


SC083 


SC083 


SC093 


SC0A3 


SC0B3 


SC0C3 


SC0D3 


SC0I 3 


SC0F3 


SC084 


SC084 


SC094 


SC0A4 


SC0B4 


SC0C4 


SC0D4 


SC0E4 


SCBF4 


SC085 


SC085 


SC095 


SC0A5 


SC0B5 


SC0C5 


SC0D5 


Si hi - : 


SC0F5 


SC086 


SC086 


SC096 


SC0A6 


SC0B6 


SC0C6 


SC0D6 


SC0E6 


SC016 


SC087 


SC087 


SC097 


SC0A7 


SC0B7 


SC0C7 


SC0D7 


SC0E7 


SC0F7 


SC088 


SC088 


SC098 


SC0A8 


SC0B8 


SC0CS 


SC0D8 


SCAE8 


SC0F8 


SC089 


SC089 


SC099 


SC0A9 


SC0B9 


SC0C9 


SC0D9 


SC0E9 


SC0F9 


SC08A 


SC08A 


SC09A 


S< \ \ 


SC0BA 


SC0CA 


SC0DA 


SC0FA 


SC0FA 


SC08H 


SC08B 


SC09B 


SC0AB 


SC0BB 


SC0CB 


SC0DB 


SC0FB 


SC0FB 


SC08C 


SC08C 


SC09C 


SC0AC 


SC0BC 


SC0CC 


SC0DC 


SC9EC 


SC0FC 


SC08D 


SC08D 


SC09D 


SC0AD 


SC0BD 


SC0CD 


SC0UD 


SC0FD 


SC0FI3 


SC08E 


SC08F 


SC09E 


SC0AE 


SC0BF 


SC0CE 


SC0DE 


SC0EE 


SC0FE 


SC08E 


SC08F 


SC09F 


SC0AF 


SC0BF 


SC0CF 


SC0DF 


SC0EF 


SC0FF 










I/O Locations 









133 



Table 26: I/O Scratchpad RAM Addresses 


base 






Slot Number 






Address 


1 


2 


3 


4 


5 


6 


7 


SH47S 


S0479 


S047A 


S047B 


S047C 


S047D 


$047 F 


S047F 


S04F8 


S04F9 


S04FA 


S04FB 


S04FC 


$04 FD 


S04FF 


S04FF 


S0578 


$0579 


S057A 


S057B 


S057C 


S057D 


S057E 


S057F 


M5F8 


M5F9 


$05 FA 


S05FB 


S05FC 


S05FD 


$05 FF 


S05FF 


S067H 


S0679 


S067A 


$«7B 


S067C 


S067D 


$067 F 


S067F 


1061 8 


S06F9 


S06FA 


$06 FB 


S06FC 


S06FD 


$06 FF 


$0(>FF 


507 78 


S0779 


S077A 


S077B 


S077C 


S077D 


S077F 


S077F 


S07F8 


$07 F9 


S07FA 


S07FB 


S07FC 


$07 1 |i 


$071 1 


$071-1 



r 



134 



APPENDIX 
ROM LISTINGS 



L' 




[36 MJTOSTAR1 ROM LISTING 
155 MONITOR ROM LISTING 





135 



AUTOSTART ROM LISTING 



oooc 

00 Of; 

0000 

OOOO 

0000 

0000 

0000 

0000 

0000 

0000 

0000 

0000 

0000 

0000 

0000 

OOOO 

0000 

OOOO 

F800 

FBOO 

PBOO 

FBOO 

FBOO 

FBOO 

FBOC 

FBOO 

FBOO 

FBOO 

FBOO 

F800 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO: 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 

FBOO 



....... 



>■>. ■«•■•.-. ..»*-. e.« • ~ " • 



3 * 






* * APPLE 


II 




5 » MONITOR II 


7 ■ COPVRIGHT 


1976 BV 


e * APPLE 


COMPUTER. INC 


9 * 






10 ♦ ALL RIGHTS RESERVED 


XI • 






12 » STEVE 


WDZNIAK 


13 » 






14 »•••••*••»•■»•»■••■••«»-«»»•»»• 


IS » 






'.'. ' MODIFIED NOV 197B 


17 ■ BV JOHN A 




16 » 






1 "5 • — ■■••■■>.■* 


•••••»•»*•«•»••»»•• r 


2C 


ORG 


•FBOO 


71 


OBJ 


•2000 


23 LOCO EGU *00 


24 LOCI 


EGU 


• 01 


25 WNDLFT 


EQU 


•20 


26 WNDWDTH 


EGU 


•21 


27 WNDTOP 


EGU 


•22 


28 WN0BTP1 


EGU 


•23 


2^ CM 


EGU 


• 24 


30 CV 


EQU 


•25 


31 GQASL 


EGU 


•26 


32 COASH 


EQU 


•27 


33 OASL 


EQU 


•28 


3a BASM 


EQU 


• 29 


35 BASEL 


EGU 


•2A 


3e BAS2H 


EGU 


•SB 


3~ -? 


EGU 


«2C 


36 LMNEM 


EQU 


•2C 


3 a V2 


EQU 


•2D 


4 RMNEM 


EQU 


•2D 


41 MASK 


EGU 


»2E 


■■K5UM 


EQU 


C2E 


43 FORhAT 


EQU 


*2E 


a-i LASTIN 


EQU 


•2F 


43 LENGTH 


EGU 


•2F 


46 SIGN 


EGU 


•2F 


47 COLOR 


EGU 


•30 


4B MODE 


EGU 


•31 


49 INVFLG 


EQU 


•32 


90 PROMPT 


EGU 


•33 


SI VSAV 


EGU 


• 34 


52 VSAV1 


EGU 


• 35 


53 CSWL 


EQU 


• 36 


54 CSWH 


EOU 


•37 


55 KSWL 


EQU 


•3B 


56 KSWH 


EGU 


• 39 


57 PCL 


EQU 


• 3A 


58 PCH 


EGU 


• 3B 


59 AIL 


EGU 


»3C 


60 AIM 


EGU 


•3D 


61 A2L 


EQU 


•3E 


t2 A2H 


EGU 


• 3F 


63 A3L 


EGU 


• 40 


64 A3H 


EQU 


•41 


65 A4L 


EGU 


•42 


06 A4M 


EGU 


•4 3 


67 A5L 


EGU 


• 44 


6E A5H 


EGU 


• 45 



E* 

E 



136 



FBOO 






e9 ACC 


EQU 


S4 5 , NOTE OVERLAP WITH A5H 


FBOO 






... 


EQU 


«4o 


FBOO 






". vREC 


EQU 


• 47 


FBOO 






" STATUS 


EQU 


*4e 


FBOO 






73 BPNT 


EQU 


•49 


FBOO 






74 BNDL 


EQU 


*4E 


FBOO 






7S RNDH 


EQU 


*4F 


fboo 






7* PICK 


EQU 


•93 


FBOO 






"*7 IN 


EGU 


•0200 


FBOO 






IB DRKV 


EQU 


*3F0 . NEU VECTOR FOR DRK 


FBOO 






79 SOFTEV 


EQU 


•3F2 . VECTOR FDR WARM STAR' 


FBOO 






BO PWREDUP EQU 


•3FJ , THIS MU5T - EOB **A5 ( 


FBOO 






Cl A-1PERV 


EQU 


• 3F5 . APPLESOFT t, EXIT VECT( 


FBOO 






B2 U5RADR 


EQU 


•03FB 


FBOO 






S3 Nil I 


EQU 


• 03FD 


FBOO 






B4 IRQLOC 


EQU 


• 3FE 


FBOO 






S3 LINE1 


EQU 


•400 


FBOO 






Br MSLOT 


EQU 


• 07F8 


FBOO 






B7 IOADR 


EQU 


• COOO 


FBOO 






BB KBD 


EQU 


•COOO 


FBOO 






B9 KBDSTRE 


1 EQU 


• C010 


FBOO 






*»0 TAPEOUT EQU 


•C020 


FBOO 






91 SPKR 


EQU 


•C030 


FBOO 






92 TKTCLR 


EQU 


•C050 


FBOO 






93 TXTSET 


EQU 


•C051 


FBOO 






9fl MIXClR 


EQU 


•C052 


FBOO 






P5 MIXSET 


EQU 


•C053 


FBOO 






9o LDWSCR 


EQU 


•C034 


FBOO 






97 HISCR 


EQU 


• C035 


FBCO 






99 LORES 


EQU 


• C056 


FBOO 






99 MIRES 


EQU 


• C057 


FBOC 






100 5ETAN0 


EQU 


•C05B 


FBOO 






101 CLRANO 


EQU 


•C059 


FBOO 






102 SETAN1 


EQU 


•COM 


FBOO 






103 CLRAN1 


EQU 


•C05B 


FBOO 






104 5ETAK2 


EQU 


•C05C 


FBOO 






105 CLRAN2 


EQU 


•C03D 


FBOC 






106 SETAN3 


EQU 


•C05E 


FBOO 






107 CLRAN3 


EQU 


•C05F 


FBOO 






10B TAPE IN 


EQU 


•C060 


FBOO 






109 PADDLO 


EQU 


•C064 


FBOO 






110 PTRIO 


EQU 


»C070 


FBOO 






111 ClRROM 


EQU 


•CFFF 


FBOO 






112 BASIC 


EQU 


•EOOO 


FBOO 






1 13 BAS1C2 


EQU 


%z ■■-■■-- 


FBOO 






: -• 


PAGE 


FBOO 


4A 




1 1 5 PLDT 


LSR 


A 


FBOi 


DE 




14 


PHP 




F8G2 


l: 


a? fb 


', L7 


JSR 


OBASCALC 


FBOS 


ae 




ue 


PLP 




FB06 


.',~ 


DF 


1 19 


LDA 


M*OF 


FBOB 


90 


0? 


120 


BCC 


RTMASk 


FBOA 


=p- 


= ■.: 


121 


ADC 


• •EC' 


FBOC 


ea 


2E 


122 RTMASK 


BTA 


MASW 


FSOE 


:■: 


26 


12? PL0T1 


LOA 


(GBA5L 1, ' 


FBIO 


45 


3C 


124 


EOR 


COLDR 


FB12 


as 


EE 


:2^ 


AND 


MASK 


F0]4 


51 


: b 


:2a 


EOB 


(GBASL). Y 


FBli 


91 




127 


STA 


<GBA5L» V 


F81S 


6D 




L2B 


RTS 




FB1« 


ao 


00 =6 


129 HLINE 


JSR 


PLOT 


FBIC 


•■; 


2C 


130 HLINE1 


CPY 


H2 


FB1E 


■■■ 


II 


131 


SCE 


RTSI 


FB20 


CB 




131 


INV 




FB21 


20 


OE FB 


133 


J5R 


PLQTl 


FB24 


90 


Fo 


13« 


DCC 


HLINE 1 


FB26 


:■■ 


01 


135 VLINEZ 


ADC 


ttVOl 


FB2B 


•; 




136 VLINE 


PHA 




FB29 


ao 


00 FB 


13? 


JSR 


PLOT 


F82C 


-- 




I3S 


PLA 




FB2D 


C3 


at 


, 3C . 


CMP 


V2 


FB2P 


?fl 


FB 


140 


DCC 


VLINEZ 


F63: 


60 




141 RTS1 


RTS 





137 



FB3£ 


HC 


S* 


MS 


CLRSCR 


LDY 


»»2F 


FS34 


d: 


q; 


143 




DN£ 


CLRSC2 


F836 


-■:■ 


B7 


1^4 


CLRTOP 


LDY 


• •27 


FB3E 


B4 


2;. 


14? 


CLRSC2 


STY 


va 


FB3A 


AO 


E~ 


146 




LDV 


**27 


FB3C 


M 


00 


147 


CLRSC3 


LDA 


#•00 


F83E 


M 


30 


14B 




5TA 


COLOR 


FB4G 


2C 


28 F6 


14<* 




JSR 


VLINE 


FB43 


BB 




150 




D£V 




FBAfi 


10 


= -. 


13 1 




BPL 


CLPSC3 


FB46 


60 




152 




RTS 




F64 7 






15; 




PAGE 


F847 


-;:- 




154 


GBASCALC PHA 


FB4B 


■A 




; c ' 




LSP 


A 


FB49 


2S 


C? 


ISo 




AND 


w»03 


FB4E 


09 


04 


157 




DRA 


"»04 


FB4I 


St 


z~ 


156 




STA 


CBA5H 


F84 c 


66 




15" 




PLA 




F850 


34 


IE 


16C 




AND 


■ •18 


F852 


c '_ 


OS 


161 




BCC 


OBCALC 


FB5« 


- : 


7? 


161 




ADC 


*I»7F 


FS.56 


BE 


i-Z 


163 


GBCALC 


STA 


GBASL 


FB5B 


0* 




164 




ASL 


A 


F85° 


3* 




165 




ASL 


A 


FBiA 


OS 


26 


166 




OR A 


GDASL 


FB5C 


ee 


2(s 


. " 




BTA 


GBASL 


FB5E 


6G 




leG 




RTS 




Ffl5F 


A5 


:■: 


169 




LDA 


COLOR 


FB.-1 


IP 




170 




CLC 




FB62 


C = 


03 


[71 




ADC 


••03 


FB64 


pq 


Of 


i-r 


SETCOL 


an: 


• •OS- 


F86; 


BS 


30 


l"*3 




STA 


COLOR 


Face 


0~ 




174 




ASL 


A 


FB6° 


OA 




175 




ASL 


A 


FBAA 


Qfi 




176 




A5<- 


A 


FB6D 


D* 




I — 




A5L 


A 


FB6C 


M 


90 


178 




ORA 


COLOR 


FB6E 


^ : 


30 


17P 




STA 


COlOP 


FB70 


w 




180 




RTS 




FB71 


«A 




181 


SCRN 


LS» 


A 


F872 


OB 




182 




PMT 




FB73 


20 


47 F6 


183 




JSR 


GBASCALC 


F876 


B3 


26 


:-:i- 




LDA 


I GBASL). 


F87B 


26 




185 




PLP 




FB79 


90 


04 


186 


SCRN2 


BCC 


RTMSK2 


F87B 


4A 




18" 




LSR 


A 


FB7C 


.;... 




IBB 




LSR 


A 


F87D 


.... 




189 




LSR 


A 


FB7E 


4A 




190 




L5R 


A 


FB7F 


29 


OF 


1»1 


P TM5I-. Z 


AND 


W*OF 


FBB1 


6C 




192 




RTS 




F882 






193 




PACE 


FBBZ. 


A5 


3A 


1°- 


IN5D51 


LDX 


PCL 


FBB4 


A4 


3B 


195 




LDV 


PCM 


FBBc 


2: 


96 FD 


- 




J5P 


PRVX2 


F8B9 


20 


46 FP 


197 




JSR 


PR8LNK 


FBBC 


Al 


3A 


I9B 


INSDS2 


LDA 


(PCL. * > 


FBBc 


AB 




19C 




TAV 




F8BF 


4A 




200 




LSR 


A 


F890 


90 


0- 


201 




CCC 


I EVEN 


FB92 


6A 




202 




ROR 


A 


FB93 


BC 


10 


203 




BCS 


ERR 


FB95 


C9 


A3 


204 




CMP 


»»A2 


FB97 


FO 


oc 


205 




BEO 


ERR 


FB99 


29 


a~ 


204 




AND 


M«B7 


FB9D 


4A 




207 


I EVEN 


LSR 


A 


FB9C 


AA 




206 




TA- 




F89D 


BD 


62 F9 


209 




LDA 


FMT1. X 


F8A0 


20 


79 FB 


210 




JSR 


SCRN2 


FBA3 


DO 


04 


211 




BNE 


OETFMT 


F8A5 


AO 


SO 


212 


ERR 


LDY 


• •BO 


FBA7 


A9 


OC 


213 




LDA 


•••00 


F8A9 


AA 




214 


OETFMT 


TAX 





13K 





FBAA 


BD A6 


-c 


21- 




LDA 


FMT2, X 


• 


FBAD 


65 2E 








STA 


FORMAT 


z 


FBAF 


2° 03 




217 




AND 


••03 




FBH) 


85 2F 




21B 




STA 


LENGTH 


_ 


FBB3 


9B 




219 




TVA 




• 


F8B4 


29 BF 




22C 




AND 


• *8F 




F8B6 


AA 




221 




TA>. 




* 1 


FBB7 


9B 




222 




TVA 




" 


FBB6 


AO 03 




223 




LDY 


• »03 




FBBA 


EO BA 




224 




CPX 


**8A 




FBBC 


FO OB 




225 




BEQ 


MNNDX3 


* 


FSBE 


4*. 




226 


MNNDX1 


LSR 


A 


- 


FBBF 


90 OB 




22 7 




BCC 


MNNDX3 




FBC1 


4A 




22E 




L5R 


A 




F8C2 


4A 




229 


MNNDX2 


LSR 


A 


_ 


FBCa 


09 20 




230 




OR A 


•*20 




FBC5 


8£ 




231 




DEV 






F8C6 


DO FA 




232 




BNE 


MNNDX2 


m 


FBCB 


CB 




233 




1NV 




— 


FSC9 


SB 




23« 


1NNDX3 


DEV 






FBCA 


DO F2 




233 




BNE 


MNNDX 1 


- 


FBCC 


60 




236 




RTS 




- 


FBCD 


FF FC 


" 


B37 




DFD 


•FF.«FF, »FF 




•BPl 






23E 




PACE 




FBDC 


£0 B2 


c e 


2 3* 


IN5TDSP 


JSR 


1NSDS1 


- 


FBD3 


AB 




- a ~ 




PHA 




— 


FQD« 


Bl 3A 




241 


PRNTOP 


LDA 


(PCD. V 




FBU& 


20 DA 


FI 


242 




J5R 


PRBVTE 


« 


FBIW 


AS 01 




243 




LDX 


• *0l 


- 


FBDB 


20 «A 


F9 


244 


PRNTBL 


JSR 


PRBL2 




FBDE 


C-J 2F 




245 




CPV 


LENGTH 




FBEO 


C8 




246 




INY 




2 


FBE1 


90 Fl 




247 




DCC 


PRNTOP 




FBE3 


A2 03 




24 B 




LDX 


••03 




F8E5 


CO OA 




.-AC 




CPV 


• »04 




FBE" 1 


90 FZ 




250 




BCC 


PRNTBL 




F8E9 


66 




251 




PLA 






FBEA 


A6 




252 




TAV 




— 


FBEE 


D° CO 


F9 


253 




LDA 


MNEML. V 


3 


FBES 


65 2C 




254 




STA 


LMNEM 




F8F0 


B9 00 


FA 


255 




LDA 


MNEMR V 




F6F3 


65 2D 




256 




STA 


RMNEM 


- 


FBF5 


A9 00 




25~ 


NXTCOL 


LDA 


• •00 


— 


FBF7 


AO M 




23e 




LDV 


••05 




F6F9 


06 2D 




259 


PRMN2 


A5L 


RMNEM 


• 


FBFE 


26 2C 




260 




ROL 


LHNEM 


FBFD 


2A 




26] 




RGL 


A 




FBFE 


BE 




262 




DEV 







FBFF 


DO F8 




263 




BNE 


PRMN2 


■ 


F901 


60 BF 




264 




ADC 


• «B C 




F903 


20 ED 


FD 


265 




JSR 


COUT 




F906 


CA 




266 




DEX 




m 


F907 


DO EC 




267 




BNE 


NXTCOL 




F909 


20 4B 


r-. 


26B 




JSR 


PRBLNK 




F9UC- 


AA 2F 




2t = 




LDV 


LENGTH 


— 


F90E 


A2 06 




270 




LDX 


• •06 


* 


F910 


EO 03 




271 


PRA0R1 


CPX 


• •03 




F912 


FO 1C 




272 




BEQ 


PRADR3 




F9I4 


06 2E 




273 


PRADR2 


ASL 


FDRMAT 


- 


FOl6 


9C OE 




274 




BCC 


PRADR3 


F916 


BD B3 


F9 


275 




LDA 


CHAR1-1. • 




F91B 


20 ED 


FD. 


276 




JSR 


COUT 


5 


F91E 


BD B9 


F9 


277 




LDA 


CHAR2-1, X 


F92I 


FO 03 




276 




BEQ 


PRADR3 




F923 


20 ED 


FD 


279 




J5R 


COUT 


»• 


F926 


CA 




280 


PRADR3 


DE» 




- 


F927 


DO E7 




281 




BNE 


PRADR1 




F929 


60 




262 




RTS 






F92A 


ee 




283 


PRADR4 


DE' 




5 


F92B 


30 E7 




284 




BMI 


PR ADR 2 


F92D 


20 DA 


FL 


285 




JSR 


PRBVTE 




F930 


AS 2E 




2B6 


PRADR5 


LDA 


FORMAT 


— 


F932 


C9 EB 




287 




CMP 


«*■::■ 



139 



F934 


Bl 


3* 


288 




LDA IPCLI. V 


F930 


90 


F2 


289 




BCC PR ADR 4 


F93B 






29C 




PACE 


F93B 


20 


5c " 


291 


RE..ADR 


JSR PC AD. '3 


F93D 


AA 




292 




TAX 


F93C 


£E 




2=3 




IN* 


F93D 


"-:■ 


01 


294 




BNE PRNTYX 


F93F 


cc 




295 




IN> 


F940 


96 




296 


PRNTYX 


TVA 


F941 


20 


DA FD 


2°7 


PRNTAX 


JSR PRBVTE 


F944 


BA 




29B 


PRNTX 


TXA 


F945 


•'•■: 


DA FD 


299 




JKP PRBVTE 


F940 


AS 


03 


300 


PPQLNK 


LDX »»02 


F9flA 


A9 


AO 


301 


PRBL2 


LDA »*A0 


F94C 


20 


ED FD 


302 


PRDL3 


JSR COUT 


F94F 


* 




303 




DE» 


F950 


DO 


FG 


304 




BNE PRBL2 


F952 


ho 




305 




RTE 


F933 


3B 




306 


PC AD J 


SEC 


rp?i 


A5 


2F 


307 


PCADJ2 


LDA LENGTH 


F956 


A4 


3f 


30c 


PCADJ3 


LDY PCH 


F95B 


AA 




30= 




TAX 


F959 


: D 


01 


310 




BPl PCADJ4 


F9SE 


es 




3] 1 




DEV 


F95C 


65 


:■-■■ 


312 


PCADJ4 


ADC PCL 


F95E 


90 


1 


313 




BCC RT52 


F960 


CB 




314 




INV 


F961 


t* 




315 


RTS2 


RTS 


F962 


CM 




3lo 


FMT1 


DFE «04 


F963 


2C 




317 




DFB *20 


F96* 


54 




310 




DFB «54 


F9fcS 


30 




319 




DFD *30 


F966 


;.r 




320 




DFC »0D 


F9&7 


BC 




321 




DFD SBO 


F966 


.... 




322 




DFB *04 


T969 


9C 




323 




DFD »90 


F96A 


03 




324 




DFB «03 


F96B 


2= 




323 




DFB S22 


F96C 






326 




DFB S54 


F96D 


23 




3E 




DFB S33 


F96E 


00 




326 




DFB «0D 


F96F 


BO 




329 




DFB »B0 


F970 


M 




330 




DFB «04 


F97I 


-■" 




331 




DFB »90 


F972 


-.: 




332 




DFB S04 


F973 


30 




332 




DFB *20 


F974 


S4 




334 




DFB »54 


F975 


33 




335 




DFB *33 


F976 


OB 




336 




DFB COO 


F977 


EC' 




337 




DFB »80 


F976 


04 




33B 




DFB »04 


F979 


90 




339 




DFB *90 


F97A 


CM 




340 




DFD S04 


F97B 


SO 




341 




DFB *20 


F97C 


; -- 




342 




DFC «54 


F97D 


33 




343 




DFB «3B 


F97E 


OD 




344 




DFB *0D 


F97F 


BO 




345 




DFB *B0 


F980 


04 




346 




DFD »D4 


F9B1 


90 




347 




DFB *90 


F9B2 


00 




34B 




DFD *00 


F9B3 


22 




349 




DFB *22 


F9B4 


... 




35C 




. ' !.... 


F9B5 


33 




35: 




DFB S33 


F98e. 


DC 




352 




DFE *0D 


F9B7 


CB 




353 




DFB SCB 


F9S8 


an 




354 




DFP *4J 


F989 


00 




355 




DFD *00 


F9BA 


i ; 




35o 




DFB si: 


F9BB 


•T. 




357 




DFE S22 


C9BC 


44 




35P 




DFB S44 


F9BD 


33 




359 




DFD S33 


F9BE 


00 




3oO 




DFB SOD 



1-1(1 



- 

- 






F9BF 


C9 


361 


DFB *CS 


F990 


44 


362 


DFB 444 


F991 


A9 


363 


DFB 4A9 


F992 


01 


364 


DFB 401 


F993 


;<r 


3*5 


DFB ILL 


F994 


44 


366 


DFB *44 


F995 


33 


■ 


DFB 433 


F99e 


00 


36B 


DFB *0D 


F99"* 


eo 


369 


DFB *B0 


F99e 


04 


370 


DFB 404 


F99Q 


; : 


371 


DFB 490 


F99A 


01 


372 


DFB 401 


F99B 


22 


372 


DFB 422 


F99C 


44 


374 


DFB 444 


F99D 


33 


3^: 


DFB 433 


F99E 


OD 


37* 


DFB 40D 


F99F 


BO 


377 


DFB 480 


F9A0 


04 


376 


DFB »04 


F9A1 


« 


379 


DFB 490 


F9A2 


::. 


380 


DFB 426 


F9A3 


31 


331 


D^D 431 


F9A4 


c~ 


382 


DFB 487 


F9A5 


9A 


3B3 


DFB 49A 


F9A6 


so 


384 Fr,T2 


DFB »00 


F9A? 


21 


385 


DFD 421 


F9AB 


e: 


3Be 


DFB 481 


F9A9 


Ba 


387 


DFD *B2 


F9AA 


00 


388 


DFB 400 


F9AB 


oo 


3B9 


DFB 400 


F9AC 


94 


390 


DFB 459 


F9AD 


4D 


391 


DFB *4D 


F9AE 


91 


?■;;: 


DFB *91 


F9AF 


92 


393 


DFB *92 


F9B0 


6b 


394 


DFB 486 


F9B1 


4A 


3=>5 


DFB 44A 


F9B2 


BS 


3<?6 


DFB S85 


F9B3 


■■: 


397 


DFB 49D 


F9B4 


AC 


396 CHAR I 


DFB *AC 


F9BS 


A9 


399 


DFE 4A9 


F9D6 


AC 


400 


DFB 4AC 


F9B7 


A3 


401 


DFB 4A3 


F9BB 


AB 


402 


DFB «AB 


F90<J 


A4 


403 


DFB 4A4 


F9BA 


D4 


404 CHAR2 


DFB 4D9 


F9BB 


00 


405 


DFD 400 


F9BC 


Dfi 


406 


DFB 4DB 


F9IID 


A4 


407 


DFB *A4 


F9BE 


ft | 


406 


DFB 4A4 


F9BF 


00 


40^ 


DFB «00 


F«CO 


■ - 


410 MNEML 


DFB «1C 


cpci 


BA 


41 : 


DFB 4BA 


F9C2 


1C 


412 


DFD 41C 


F9CC- 


23 


41? 


DFB 423 


F9C4 


-_■: 


414 


DFC 45D 


F9C5 


BE 


1 


DFB 4BB 


F9C6 


IB 


41c 


DFB 41B 


F9C~ 


Al 


417 


DFB 4A1 


F9CB 


90 


4ie 


DFB 49D 


F9C9 


BA 


419 


DFB 4BA 


F9CA 


lr 


~z>: 


DFB 41 D 


F9CB 


23 


-z\ 


DFB 423 


F9CC 


9Q 


42Z 


DFB 49D 


F9CD 


BB 


423 


DFB *BB 


F9CE 


IS 


424 


DFB *1D 


F9CF 


Al 


42? 


DFB 4A1 


F9D0 


00 


426 


DFE 400 


F9D1 


24 


427 


DFD 429 


F9D2 


14 


42e 


DFB 410 


F9D2 


Ml 


429 


DFB 4AE 


F9D4 


64 


430 


DFB 469 


F9D5 


.".! 


4?1 


DFB 4AB 


F9D6 


1 - 


432 


DFB 419 


'<=7." 


23 


433 


DFB 423 



14: 



F9DB 


2-1 


434 


DFE 


*:- 


F9D9 


33 


433 


DFD 


• 53 


F9DA 


ID 


436 


DFB 


• ID 


F9DB 


23 


437 


DFB 


•23 


F9DC 


94 


438 


DFB 


•24 


F9DD 


53 


4?9 


DFB 


•53 


F9DE 


19 


440 


DFB 


• 19 


F9DF 


Al 


441 


DFB 


•Al 


F9E0 


DC 


442 


DFB 


•00 


F9EI 


1A 


44? 


DFB 


• 1A 


F9E2 


?:-■ 


444 


DFB 


• 5G 


F9E3 


5r 


445 


DFB 


• 5D 


F9E4 


AS 


•:-_ 


DFB 


• A5 


F9E5 


69 


447 


DFB 


• 69 


F9E6 


24 


44B 


DFB 


• 24 


F9E? 


24 


449 


DFB 


• 24 


F9EB 


Al 


450 


DFB 


• AE 


F9E9 


AE 


4S1 


DFB 


• AE 


F9EA 


AG 


452 


DFB 


• A6 


F9E8 


»: 


.:• 


DFB 


•AD 


F9EC 


29 


454 


DFD 


• 29 


F9E& 


00 


455 


DFD 


•00 


F9EE 


ft 


456 


DFB 


•7C 


F9EF 


00 


457 


DFD 


•00 


F9F0 


IS 


4 58 


DFB 


• 15 


F9F1 


9C 


459 


DFB 


•9C 


F?F2 


6D 


460 


DFD 


•6D 


F9F3 


9C 


461 


DFB 


•9C 


F9F4 


A3 


462 


DFD 


•A5 


F9F5 


69 


463 


DFD 


• 69 


F9F6 


BS 


464 


DFD 


•29 


F9F7 


53 


465 


DFB 


• 53 


F9FB 


• i.i 


466 


DFB 


•84 


F9F9 


13 


467 


DFfl 


• 13 


F9FA 


34 


468 


DFB 


• 34 


F9FD 


1 1 


469 


DFB 


• 1 1 


F9FC 


A5 


470 


DFD 


»A5 


F9FD 


69 


4-1 


DFD 


•69 


F9FE 


23 


■■ ■ 


DFD 


• 23 


F9FF 


M 


4^3 


DFD 


•AO 


FAOO 


:■:■ 


474 MNEHR 


DFB 


•oe 


FAOl 


bS 


4~5 


DFB 


•62 


FAOS 


54 


47ft 


DFB 


• 5A 


FA03 


•!:■ 


477 


DFD 


• 46 


FA04 


26 


47B 


DFB 


•26 


FA05 


62 


479 


DFB 


•62 


FA06 


94 


4ae 


DFB 


•94 


FA07 


Be 


481 


DFO 


•BE 


FA08 


54 


462 


DFB 


• 54 


FA09 


44 


483 


DFB 


• 44 


FAOA 


ce 


.. ,.1 


DFB 


*CB 


FAOt 


54 


4B3 


DFB 


• 54 


FAOC 


u 


49b 


DFB 


•68 


FAOD 


44 


4B7 


DFB 


S44 


FAOE 


-:■:- 


465 


DFB 


*EB 


FAOF 


94 


AB9 


DFD 


•94 


FAIO 


00 


490 


DFB 


•00 


FA11 


: 4 


491 


DFB 


• B4 


FA 12 


:■•-- 


49; 


DFB 


• 08 


FAI3 


B4 


493 


DFB 


•84 


FAli 


74 


494 


DFB 


• 74 


FAI5 


[■ 4 


495 


DFB 


»B4 


FA16 


2E 


49 e 


DC0 


•2B 


FA17. 


6E 


497 


DFB 


•6E 


faib 


~^ 


498 


DFB 


• 74 


FAI9 


C4 


499 


DFE 


• F4 


FA1A 


cc 


500 


DFB 


•CC 


FA1D 


4A 


501 


DFB 


»4A 


FAIC 


~; 


f ■:■; 


DFB 


• 72 


PAID 


fh 


503 


Of I 


•F2 


FA1E 


A4 


504 


DFB 


•A4 


FA1F 


BA 


505 


DPB 


•BA 


FA20 


00 


506 


DFB 


• 00 



142 



- 



FA21 


AA 






50" 




DFB 


SAA 




FA22 


U 






506 




DFB 


• A2 




FA23 


A2 






509 




DFB 


•A2 




FA24 


7a 






510 




DFB 


*7A 




FA25 


74 






511 




DFB 


• 74 




FA26 


74 






512 




DFB 


• 74 




FA27 


72 






»:3 




DFB 


• 72 




FA2B 


44 






Sl« 




DFB 


• 44 




FA29 


66 






515 




DFB 


*66 




FA2A 


BS 






516 




DFB 


•B2 




FA2B 


32 






517 




P- I 


•32 




FA2C 


32 






516 




DFB 


• B2 




FA2D 


00 






■ : : ' 




DFB 


400 




FA2E 


22 






520 




DFB 


*22 




FA2F 


00 






521 




DFB 


•00 




FA30 


1A 






522 




DFB 


• 1A 




FA31 


1A 






523 




DFD 


• 1A 




FA32 


2b 






534 




DFB 


»2b 




FA33 


2b 






525 




DFB 


•26 




FA34 


72 






526 




DFB 


• 72 




FA35 


72 






527 




DFE 


• 72 




FA3£ 


BB 






526 




DFD 


•88 




FA37 


CB 






52° 




DFB 


• CB 




FA36 


C4 






530 




DFE 


•C4 




FA29 


CA 






531 




DFB 


•CA 




FA3A 


2b 






532 




DFD 


•26 




FA3B 


4B 






533 




DFB 


»4P 




FA3C 


^^ 






534 




DFD 


• 44 




FA3D 


^_ 






535 




DFB 


•44 




FA3E 


A2 






53e 




DFB 


• A2 




FA3" 


Cfi 






537 




DFB 


• C6 




FA40 








536 




PAGE 




FA40 


es 


-- 




53<: 


IRQ 


BTA 


ACC 




FA42 


©9 






54C 




PLA 






FA43 


4E 






541 




PMA 






FA44 


0A 






542 




ASL 


A 




FA4 5 


-.•-•■ 






543 




ASL 


A 




FA46 


OA 






544 




ASL 


A 




FA47 


30 


03 




545 




DMI 


BREAK 




FA49 


6C 


ft 


03 


54b 




JHP 


< IROlOC) 




FA4C 


28 






547 


BREAK 


PLF 






FA4D 


20 


4C 


p| 


54B 




JSR 


SAV1 




FA50 


68 






549 




PLA 






FA51 


65 


JA 




550 




STA 


PCL 




FA53 


66 






551 




PLA 






FA54 


B5 


2t- 




552 




STA 


PCH 




FA56 


6C 


FO 


03 


553 




JHP 


(BRKV) 1 


BRKV WRITTEN OVER BV DISK BO 


FA59 


2t 


B2 


Fl 


554 


OLDBRK 


JSR 


IN5D51 




FA5C 


20 


DA 


FA 


555 




JSR 


RCDSP 1 




FASF 


4C 


-■■ 


FT 


556 




JHP 


MON 




FA62 


DC 






557 


RE5ET 


CLD 


. 


DO THIS FIR5T THIS TIME 


FA63 


20 


84 


FE 


55E 




JSR 


SETNORM 




FA66 


20 


2F 


FC 


559 




JSR 


INIT 




FA60 


20 


93 


FE 


560 




JSR 


SETVID 




FA6C 


20 


3~ 


Fl 


561 




JSR 


5ETK8D 




FA6F 


•••: 


se 


CO 


562 


INI TAN 


LDA 


SETANO - 


ANO - TTL HI 


FA72 


AD 


5A 


CO 


563 




LDA 


SET AM 1 


AN1 = TTL HI 


FA75 


"[ 


5D 


CO 


564 




LDA 


CLRAN2 1 


AN2 ■ TTL LO 


FA7B 


AD 


3F 


CO 


565 




LDA 


CLRAN3 - 


AN3 - TTL LO 


FA7B 


AD 


FT 


CF 


566 




LDA 


CLRROM 1 


TURN OFF EXTNSN ROM 


FA7E 


EC 


i a 


CO 


5s- 




BIT 


KBDSTRB 


1 CLEAR KEYBOARD 


FAB I 


DB 






568 


NEWMON 


CLD 






FAB2 


sc 


3A 


FF 


569 




JSR 


BELL 1 


CAUSES DELAY IF KEY BOUNCES 


FAB5 


a: 


FS 


03 


570 




LDA 


SOFTEV* 1 


1 IB RESET HI 


FAB8 


49 


A5 




571 




EOR 


*«A5 


A FUNNY COMPLEMENT OF THE 


FA8A 


CD 


F4 


03 


572 




CMP 


PWREDUP 


I PUP UP BYTE ^7 


FABD 


DO 


17 




573 




BNE 


PWRUP 1 


NO 50 PWRUP 


FABF 


AD 


T 


CO 


574 




LDA 


SOFTEV 1 


YE5 5EE IF COLD START 


FA92 


DO 


OF 




575 




BNE 


NOF I X 


HAS BEEN DDNE YET? 


FA94 


A9 


EO 




576 




LDA 


«*E0 


" 


FA96 


CD 


F3 


OS 


577 




CMP 


SOFTEV- 1 


. *»? 


FA99 


DO 


oe 




57B 




BNE 


NOF I » 


VES SO REENTER SYSTEM 


FA9B 


AO 


0.1 




579 


riXBEV 


LDY 


• 3 


NO SO POINT AT WARM START 



143 



FA9D 


BC 


F2 


03 


see 




STY 


SOFTEV . FOR NEXT RESET 


FAAO 


4C 


X 


EO 


381 




J MP 


BASIC 1 AND DO THE COLD 5TART 


FAA3 
FAAa 
FAA6 


6C 


F2 


oa 


5S2 
5B3 
584 


NOFIX 


JMP 


(SOFTEVt i SOFT ENTRY VECTOR 


20 


w 


rr 


PWn .,.- 


JSR 


APPLEII 


FAA9 








385 


SETPC3 


EQU 


■ SET PAGE 3 VECTORS 


FAA9 


A2 


OB 




56s 




LDX 


■ 3 


FAAB 


BD 


FC 


FA 


5B7 


SETPLP 


_DA 


PWRCON-l.X , WITH CNTRL fl ADH5 


FAAE 


9P 


E^ 


oa 


563 




STA 


BRKV-1. X i OF CURRENT 3ASIC 


*ABt 


CA 






5?^ 




DEX 




FAB 2 


DO 


c ^ 




590 




BNE 


SETPLP 


FAB4 


A9 


CB 




591 




LDA 


•»CB I LOAD MI SLOT *i 


FAB6 


B6 


00 




592 




STX 


LOCO . SETP03 MUST RETURN X= 


FABB 


63 


:■: 




393 




5TA 


LOCI , SET PTR H 


FABA 


AO 


07 




594 


5L00P 


LDY 


•7 . Y IS BYTE PTR 


FABC 


C6 


01 




595 




DEC 


LOCI 


FABE 


A3 


01 




596 




LDA 


LOCI 


FACO 


M 


CO 




397 




CMP 


#»C0 . AT LAST SLOT VET - 


-AC2 


FO 


'- 




^,pc 




SEQ 


FIX5EV i YES AND IT CANT BE A 


FAC* 


BD 


F B 


0~ 


399 




STA 


MSLOT 


FAC7 


Bi 


C 




000 


NXTQVT 


LDA 


<LOCO).v . FETCH A SLOT BYTE 


FAC° 


D9 




Fl 


bOi 




CM* 


D I SK I D- 1 . V i 15 IT A DISK 


facc 


DO 


EC 




602 




BNE 


SLOOP . NO SO NEXT SLOT DOWN 


FACE 


SB 






b03 




DEV 




FAC= 


B6 






O04 




DEV 


I YES SO CHECK NEXT DVT 


FADO 


10 


FS 




bo: 




BPL 


NXTflVT , UNTIL 4 CHECKED 


■ .-.r-7 


oC 


OC 


00 


-o D -- 




JMP 


(LOC0> 


FADS 


E* 






=0" 




NOP 




FAD=. 


... 






boe 




NO* 




FAD7 








60° 


• REGDSP MUST ORG «FAD7 


FAD? 


20 


BE 


Fl 


610 


REG3SP 


JSR 


CROUT 


FADA 


A9 


45 




bl 1 


RGDSP 1 


LDA 


t*43 


FADC 


B8 


40 




bl2 




STA 


A3L 


FADE 


ft' 


00 




blC- 




LDA 


11*00 


FAEO 


BS 


-: 




Al« 




STA 


A3H 


FAE2 


a? 


F- 




o!3 




LDX 


**FD 


FAE4 


A9 


AC 




bib 


RDSP1 


LDA 


*»A0 


FAE6 


20 


E D 


FTJ 


617 




JSR 


COUT 


FAE9 


:■:■ 


IE 


FA 


ol8 




LDA 


RTBL-251. X 


FAEC 


2C 


EI 


FD 


Q | = 




JSR 


COUT 


FAE^ 


M 


:•: 




b20 




LDA 


KBD 


FAF1 


so 


e: 


Fl 


d21 




JSR 


COUT 


FAFJ 








o22 


• LDA ACC*5 


X 


FAF4 


BS 


4A 




623 




DFB 


«B5. S4A 


FAFb 


20 


DA 


FC 


624 




JSR 


PR BYTE 


FAF9 


EG 






625 




INX 




FAFA 


30 


EC- 




62b 




am 


RDSP1 


FAFC 


bO 






62? 




RTS 




FAFD 


59 


FA 




628 


PWRCON 


DW 


OLDSRK 


FAFF 


00 


ZC 


•:-■ 


629 




DFD 


•00. »E0. «45 


FB02 


20 


FF 


00 










FB05 


FF 






630 


DISK ID 


DFB 


•20. »FF, »00. *FF 


FB06 


03 


FF 


X 


631 




DFB 


• 03. «FF. »3C 


FB09 


CI 


DO 


DO 


632 


TITLE 


DFB 


• CI. «D0. «D0 


FBOC 


:c 


c? 


Af 


633 




DFB 


• CC. »C3. »A0 


FBOF 


DE 


DE 




634 




DFB 


SDD. *DB 


FDll 








63 = 


KLTBL 


EQU 


• 


FB11 


E4 


ca 


CI 


636 




DFB 


»C4. ftC2. *C1 


C E1* 


FF 


CJ 




637 




DFB 


•FF, »C3 


FB16 


FF 


FF 


FF 


638 




DFB 


•FF. *FF. «PF 


FBI 9 








639 


• MUST 


ORG 


•FBI 9 


FQ19 


CI 


DB 


D9 


640 


RTBL 


DFB 


•CI. SDB. SD9 


FB1C 


DO 


oa 




641 




DFB 


• DO. *D3 


FB1E 


AC 


70 


CO 


642 


PRE AD 


LDA 


PTRIG 


FB21 








643 




LST 


ON 


FB21 


AO 


00 




o4« 




LDV 


W»00 


FB23 


EA 






643 




NOP 




FB24 


EA 






646 




NOP 




FB25 


BD 


.,.-. 


CO 


647 


PHEADB 


LDA 


PADDLO. X 


FB28 


10 






64B 




BPL 


RTS2D 


FB2A 


CB 






640 




INV 




FB20 


DO 


F>: 




650 




BNE 


PREAD2 


FB2D 


BG 






651 




DEV 





Dljf 



144 



- 



3 
3 



FB2E 


60 






652 


RTS2D 


RTE 






FB2F 


,v- 


DC 




z 


INIT 


-DA 


1**00 




FB31 


B! 


4- 




_ . 




STA 


STATUS 




FB33 


AD 


5o 


CO 


4 




LDA 


LO»EE 




FB36 


AD 


54 


CO 


5 




LDA 


LOWSCR 




FB39 


AD 


5; 


CO 


i, 


SETT XT 


LDA 


TXTSET 




FD3C 


*-- 


DO 








LDA 


US 00 




FB3E 


FO 


DO 




E 




BEG 


SETUND 




FD4C 


a; 


90 


cc 


9 


SETGR 


LDA 


TXTCLR 




FD43 


At 


53 


CO 


LC 




LDA 


MIXSET 




FTK6 


2C 


36 


FB 


; i 




J5R 


CLRTOP 




FB49 


A9 


14 




12 




LDA 


• »14 




FB4B 


-^ 


Z'~ 




13 


5ETUND 


STA 


WNDTDP 




FE<D 


A9 


30 




:* 




LDA 


MOO 




FBiF 


~V 


20 




15 




STA 


WNDLFT 




FB51 


A9 


as 




16 




LDA 


»*2B 




FB53 


B! 


21 




17 




STA 


WNDWDTH 




FB35 


AC 


IB 




16 




LDA 


#»1B 




FB57 


BE 


23 




19 




STA 


WNDBTM 




FB59 


A e 


17 




20 




LDA 


••17 




FB5B 


BE 


25 




23 


TABV 


STA 


CV 




FB5D 


4C 


^r 


FC 


rr 




JMP 


VTAB 




FB60 


20 


96 


i e 


23 


APPLEII 


JSR 


HOME 


CLEAR TME SCAN 


FB63 


AC 


bb 




24 




LDV 


•e 




FB65 


B* 


BE 


FT 


25 


STITLE 


LDA 


TITUE-l. 


V . GET A CHAR 


FB6S 


r -c 


DE 


04 


26 




STA 


LlNEl+14 


V 


FB6B 


BB 






27 




DEV 






FD6C 


DO 


F7 




2E 




BNE 


STITLE 




FB6E 


60 






29 




RTS 






FB6F 


AD 


r; 


03 


30 


SETPWRC 


LDA 


50FTEV+1 




FB72 




A c 




3: 




EOR 


•*A5 




FB7A 


BI 


FA 


03 


32 




STA 


PWREDUP 




FB77 


6C 






33 




RTS 






FB7B 








34 


VIDUA IT 


EOU 


■ 


CHECK FOR A PAU5E 


FB7B 


M 


BI 




35 




CMP 


«SBD 


ONLY WHEN I HAVE A CR 


FB7A 


: ■: 


LB 




3o 




BNE 


NOWAIT 1 


NOT 50. DO REGULAR 


FB7C 


A" 


DO 


CO 


37 




LDV 


KSD 


IS KEV PRESSED'' 


FB7F 


10 


13 




3B 




BPL 


NOWAIT . 


NO 


FBB1 


CO 


w 




39 




CPV 


*»93 I 


IS IT CTL S ? 


FB83 


DO 


OF 




- " 




BNE 


NOMA I T 1 


NO SO IGNORE 


FBB5 


2C 


10 


CO 


41 




BIT 


KBDSTRB 


, CLEAR STRODE 


FBBB 


AC 


M 


CO 


42 


KBDWAIT 


LDY 


KBD 


WAIT TILL NEXT KEV TO R 


FBBB 


to 


FI 




43 




BPL 


KBDWAIT 


1 WAIT FOR KEYPRESS 


FB8D 


CO 


B3 




44 




CPV 


■*B3 


IS IT CONTROL C ? 


FBBF 


r o 


03 




45 




BEG 


NOWAIT , 


YES SO LEAVE IT 


FBVl 


sc 


10 


CO 






BIT 


KBDSTRB 


1 CLR STROBE 


FB94 


4C 


= : 


FB 


.;- 


NOWAIT 


JMP 


VIDOUT . 


DO AS BEFORE 


FB97 








■ill 




PAGE 




FB 1 " 


~~- 






40 


E5CDLD 


5EC 


1 


INSURE CARRY SET 


FB9B 


4C 


2C 


FC 


5C 




JMP 


ESC1 




FB9B 


AB 






51 


ESCNOW 


TAV 


, 


USE CHAR AS INDE» 


F39C 


:•■■■ 


.:.- 


FA 


52 




LDA 


XLTBL-»C9.V , XLATE IJHM TO CBAD 


FB9F 


?0 


97 


FB 


53 




JSR 


ESCOLD . 


DO THIS CURSOR MOTION 


FBA2 


30 


w 


FD 


54 




JSR 


RDKEV 


AND GET NEXT 


FBA5 


C9 


CE 




55 


ESC NEW 


CMP 


MCE 


IS THIS AN N 7 


FBA7 


BG 


£E 




56 




BCS 


ESCOLD » 


N OP GREATER DO IT 


FBA9 


C9 


N 




57 




CMP 


•SC9 


LE5S THAN I " 


FBAB 


90 


EA 




SB 




BCC 


ESCOLD 1 


YES SO OLD WAV 


FBAD 


C9 


cc 




59 




CMP 


•tec 


IS IT A L " 


FBAF 


FO 


E^ 




=.■: 




BEO 


ESCDLD 1 


DO NORMAL 


FBB1 


DC 


E8 




61 




BNE 


ESCNOW . 


GO DO IT 


FBB3 


£•■ 






t.7 




NOP 






FBB4 


^A 






t : 




NDP 






FBB5 


EA 






64 




NOP 






FBBc 


EA 






r. r 




NOP 






F0B7 


EA 






66 




NCP 






FBBB 


EA 






67 




NOP 






FBB9 


£A 






66 




NOP 






FBBA 


EA 






c<- 




NOP 







145 



FBOB 


EA 




70 




NPP 






FDBC 


EA 




?l 




NOP 






FBDD 


EA 




72 




NOP 






FBBE 


EA 




73 




NOP 






FBBF 


EA 




74 




NOP 






FBCO 


i~ 




75 




NDP 






FBC1 






76 


• MUST ORG 




FBC1 


48 




77 


BA5CALC 


PHA 






FBC2 


4A 




78 




LSR 


A 




FBC3 


29 


03 


79 




AND 


*»03 




FBC5 


09 


/..: 


80 




ORA 


••04 




FBC7 


BS 


29 


Bl 




STA 


BASH 




FBC9 


6B 




82 




PLA 






FBCA 


29 


LB 


63 




AND 


• MB 




FBCC 


90 


DC 


64 




BCC 


DA5CLC2 




FBCE 


69 


7F 


B5 




ADC 


• *7F 




FBDO 


85 


23 


66 


BASCLC2 


STA 


BASL 




FBD2 


DA 




87 




ASL 


A 




FBD3 


CM 




66 




ASL 


A 




FBD4 


05 


SB 


69 




ORA 


BASL 




FBD6 


85 


26 


90 




STA 


BASL 




FBDB 


60 




91 




RTS 






FBD9 


C9 


B7 


92 


BELLI 


CMP 


••B7 




FBDB 


DO 


La 


93 




BNE 


RTS2B 




FBDD 


A9 


40 


94 




LOA 


■ •40 




FBDF 


20 


AS FC 


95 




JSR 


WAIT 




FBE2 


AO 


CO 


96 




LDY 


■ SCO 




FBE4 


A- 


oc 


97 


BELL 2 


LDA 


■ •OC 




FBE6 


20 


AB FC 


9B 




JSR 


WAIT 




FBE9; 


AD 


30 CO 


99 




LDA 


SPKR 




FBEC 


B6 




100 




DEY 






FQED 


DO 


Ffl 


101 




BNE 


BELL2 




FBEF 


60 




102 


BTS2B 


RTS 






FBFO 






103 




PAOE 




FBFO 


A4 


24 


104 


STDRADV 


LDY 


CH 




FBF2 


'VI 


SB 


105 




5TA 


< BASL > i Y 




FBF4 


Er 


24 


106 


ADVANCE 


INC 


Cri 




FBF6 


a: 


24 


107 




LDA 


CH 




FBF6 


Cb 


2) 


108 




CMP 


WNDWDTH 




FBFA 


BO 


66 


109 




BCS 


CH 




FBFC 


60 




110 


RTS3 


RTS 






FBFD 


C- 


AO 


111 


VIDOUT 


CMP 


• •AO 




FBFF 


DC 


E*- 


112 




BCS 


STORADV 




FCOl 


M 




113 




TAV 






FC02 


10 


EC 


114 




DPL 


STORADV 




FC04 


C9 


6D 


115 




CMP 


•«BD 




FC06 


FO 


5A 


116 




BEO 


CR 




FCOB 


C9 


34 


117 




CMP 


•«8A 




FCOA 


F 


5A 


UB 




BEO 


LF 




FCOC 


C9 


BB 


119 




CMP 


••BB 




FCOE 


DO 


C9 


120 




BNE 


BELLI 




FCIO 


C6 


2~ 


121 


PS 


DEC 


CH 




Fcia 


10 


EO 


122 




BPL 


RTS3 




FC14 


a: 


21 


123 




LDA 


WNDWDTH 




FC16 


BS 


24 


124 




STA 


CH 




FCIB 


C6 


21 


125 




DEC 


CH 




FClA 


A5 


22 


126 


UP 


LDA 


WNDTOP 




FCIC 


C9 


25 


127 




CMP 


CV 




FC1E 


B( 


Dl 


ire 




BCS 


RTS4 




FC20 


C6 


25 


129 




DEC 


CV 




FC22 


A5 


25 


130 


VTAB 


LDA 


CV 




FC24 


20 


CI F8 


131 


VTABZ 


JSR 


BASCALC 




FC27 


65 


20 


132 




ADC 


WNDLFT 




FC29 


55 


26 


133 




STA 


BASL 




FC2B 


60 




134 


RTS4 


RTS 






FC2C 




CO 


135 


ESC1 


EOR 


• •CO ( 


esc e ? 


FC2E 


FO 


26 


136 




BEQ 


HOME 


IF SO DO HOME AND CLEAR 


FC30 


6^ 


FD 


137 




ADC 


••FD 


ESC-A OR B CHECH 


FC32 


90 


CO 


138 




BCC 


ADVANCE 


A. ADVANCE 


FC34 


FO 


DA 


139 




BEO 


BS i 


B. BACKSPACE 


FC3o. 


69 


FD 


140 




ADC 


• •FD 


ESC-C OR D CHECK 


FC38. 


90 


2C 


141 




BCC 


LF 


C i DOWN 


FC3A 


FO 


:e 


142 




BEQ 


UP i 


D, CO UP 



146 



FC3C 

FC3E 

FC40. 

FC42. 

FC44 

FC46 

FC47 

FC4A 

FC4D 

FC4F 

FC30 

FC52 

FC54 

FC56 

FC5B 

FC5A 

FCSC 

FC3E 

FC60 

FT62 

FC62 

FC64 

FC66 

FC6B 

FC6A 

FC6C 

FC6E 

FC70 

FC72 

FC73. 

FC76 

FC7e 

FC7A 

FC7C 

FC7E 

FC80 

FCB1 

FCB2 

FCB4 

FC86 

FC8B 

FC69 

FCBC 

FCBE 

FC90 

FC91 

FC93 

FC95 

CC97. 

FC9A 

FC9C 

FC9E 

FCAO 

FCA2 

FCA3: 

FCA5 

FCA7 

FCAB 

FCA9 

FCAA 

FCAC 

FCAE 

FCAF 

FCB1 

FCB3 

FCB4 

FCB6 

FCBB 

FCBA 

FCBC 

FCBE 

FCCO 

FCC2 



69 FD 

90 5C 
DO E9 
A4 24 
A5 25 
48 

20 24 FC 
20 9E FC 
AO 00 
66 

69 00 
:t 23 
90 FO 
BO CA 
A5 22 
85 25 
AO 00 

64 24 
FO E4 

A9 00 
85 24 
E6 25 
A5 25 
C5 23 
90 D 6 
C6 25 
A5 22 
48 

20 24 FC 
A5 28 
85 2A 
A5 29 

65 2D 
M 21 
86 
68 

69 01 

C5 23 

DO OD 

4fl 

20 24 FC 

Bl 28 

91 2A 

66 

10 F9 

30 El 

AO 00 

20 9E FC 

DO 86 

A4 24 

A9 AO 

91 28 

CB 

C4 21 

90 F9 

60 

38 

46 

E9 01 

DO FC 

68 

E9 01 

DO F6 

60 

E6 42 
DO 02 
E6 43 
A5 3C 
C5 3E 
: A5 3D 
ES 3F 
E6 3C 



143 

144 

145 

146 CLREOP 

147 

148 CLE0P1 

149 

150 

151 

152 

153 

154 

155 

156 

157 HOME 

196 

159 

160 

161 

162 

163 CR 

1*4 

165 LF 

166 

167 

166 

169 

170 SCROLL 

171 

172 

173 5CRL1 

174 

175 

176 

177 

178 

179 

180 

161 

162 

183 

164 

185 SCRL2 

186 

187 

163 

1B9 

190 SCRL3 

191 

192 

193 CLREOL 

194 CLEOLZ 

195 CLE0L2 
196 

197 
198 
199 

200 WAIT 

201 MAIT2 

202 UAIT3 
203 

204 

205 

206 

207 

206 NXTA4 

209 

210 

211 NXTA1 

212 

213 

214 

215 



ADC «»FD 

BCC CLREOL 

BNE RTS4 

LDV CH 

LDA CV 

PHA 

JSR VTABZ 

JSR CLEOLZ 

LDY ••00 

PLA 

ADC ••CO 

CMP WNDBTM 

BCC CLE0P1 

BCB VTAJ 

LDA WNDTOP 

5TA CV 

LDV »»00 

STY CH 

BEO CLEOP 1 

PACE 

LDA ••00 

STA CH 

INC CV 

LDA CV 

CMP WNDBTM 

BCC VTABZ 

DEC CV 

LDA WNDTOP 

PHA 

JSR VTABZ 

LDA BASL 

STA BAS2L 

LDA BASH 

STA BAS2H 

LDY WNDWDTH 

DEY 

PLA 

ADC «*01 

CMP WNDBTM 

BC5 SCRL3 

PHA 

JSR VTABZ 

LDA (BASL ). v 

STA <BAS2L>.V 

DEV 

BPL SCRL2 

BMI SCRL1 

LDV ••00 

JSR CLEOLZ 

BCS VTAB 

LDY CH 

LDA ■*»: 

STA (BASL I, V 

INV 

CPV WNDWDTH 

BCC CLE0L2 

RTS 

SEC 

PHA 

SBC ••01 

BNE WAIT3 

PLA 

SBC ••01 

BNE WAIT2 

RTS 

INC A4L 

BNE NXTA1 

INC A4H 

LDA AIL 

CMP A2L 

LDA AIM 

5BC A2H 

INC AIL 



ESC-E OR F CKECK 

E. CLEAR TD END OF LINE 

ELSE NOT F. RETURN 

ESC F IS CLR TO END OF PACE 



147 



FCC4 


DO 02 




216 




BNE 


RTS4B 


FCC6 


Ee 3D 




217 




INC 


A1H 


FCCB 


60 




21B 


RTS4S 


RTS 




FCC 






2:9 




PACE 


FCC9 


AO 4B 




220 


MEADB 


LDV 


• *4B 


FCCB 


20 DB 


FC 


221 




JSP 


ZERDLV 


FCCE 


DO F9 




222 




BNE 


HE ADR 


FCDO 


69 FE 




223 




ADC 


MFE 


FCD2 


BC F5 




224 




BC5 


HE ADR 


FCD4 


AC 2! 




225 




LDY 


*S2l 


FCD6 


20 DB 


re 


226 


URD1T 


JSR 


ZERDlv 


FCD9 


CB 




227 




INY 




FCDA 


CB 




22B 




INY 




FCDB 


BE 




229 


ZERDLY 


DEY 




FCDC 


DO FD 




230 




BNE 


ZERDLV 


FCDE 


90 05 




231 




BCC 


WRTAPE 


FCEO 


AO 32 




232 




LDV 


0*32 


FCE2 


se 




233 


ONEDLY 


DEY 




FCE3 


DO FD 




23* 




BNE 


ONEDLV 


FCE5 


AC 20 


CO 


235 


WRTAPE 


LDY 


TAPEOUT 


FCEB 


AO 2C 




236 




LDY 


«*2C 


FCEA 


CA 




237 




DEX 




FCED 


60 




238 




RTS 




FCEC 


A2 08 




239 


RDBYTE 


LOU 


■ SOB 


FCEE 


46 




240 


RDBVT2 


PHA 




FCEF 


20 FA 


r : 


241 




JSR 


RD2BIT 


FCF2 


6E 




242 




PLA 




FCF3 


2A 




243 




ROL 


A 


FCF4 


AO 3A 




244 




LDY 


«-•:■•- 


«=CF6 


CA 




245 




DEX 




FCF7 


DO FS 




246 




BNE 


RDBYT2 


FCF9 


60 




247 




RTS 




FCFA 


20 FD 


re 


248 


RD2BIT 


JSR 


RDBIT 


FCFD 


BB 




249 


RDBIT 


DEY 




FCFE 


AD 60 


CO 


250 




LDA 


TAPE IN 


FDOl 


45 2F 




251 




EOR 


LAST IN 


FD03 


10 FB 




252 




8PL 


RDBIT 


FD05 


45 2F 




253 




EOR 


LAST IN 


FD07 


85 2F 




254 




STA 


LASTIN 


FD09 


CO 80 




255 




CPY 


• •BO 


FDOB 


60 




256 




RTS 




FDOC; 


A4 24 




257 


RDMEV 


LDY 


CH 


FDOE 


B! 28 




258 




LDA 


( BASL ) i V 


FDIO 


48 




259 




PHA 




FD11 


29 3F 




260 




AND 


«»3F 


FD13 


09 40 




261 




DRA 


M40 


FD15 


91 28 




262 




STA 


(BASD. Y 


FD17 


68 




263 




PLA 




FD1B 


6C 3B 


00 


264 




JMP 


(KSWL) 


FDlB 


E6 4E 




265 


KEVIN 


INC 


RNDL 


FD1D 


DO 02 




266 




BNE 


KEYIN2 


FD1F 


E6 4F 




267 




INC 


RNDM 


F021 


2C 00 


CD 


268 


KEVIN2 


BIT 


KBD | 


FD24 


10 F5 




269 




BPL 


KEYIN 


FD26 


91 2B 




270 




STA 


(BASL), V 


FD28 


AD 00 


CO 


271 




LDA 


KBD 


FD2B 


2C 10 


CO 


272 




BIT 


K8D5TRD 


FD2E 


60 




273 




RTS 




FD2F 


20 OC 


FD 


274 


ESC 


JSR 


RDKEY 


FD32 


20 AS 


Ffl 


275 




JSR 


ESC NEW 


FD35 


20 OC 


FD 


276 


R DC MAR 


J5R 


RDKEY 


FD38 


C9 OG 




277 




CUP 


• »9B 


FD3A 


FO F3 




278 




BEO 


ESC 


FD3C 


frC 




2^9 




RTS 




FD3D 






280 




PAGE 




FD3D 


A5 32 




281 


NOTCR 


LDA 


INVFLG 


FD3F 


48 




282 




PHA 




FD40 


A" FF 




2B3 




LDA 


#*FF 


FD42 


85 32 




294 




STA 


INVFLG 


FD44 


BD 00 


02 


285 




LDA 


IN, X 


FD47 


20 ED 


FD 


286 




JSR 


COUT 


FD4A 


68 




287 




PLA 




FD4B 


B5 32 




288 




STA 


INVFLG 



READ KEYBOARD 



148 



FD4D 


BD 


DO 


02 


289 




LDA 


IN, X 


FD50 


C9 


bL- 




290 




CMP 


• »BB 


FDS2 


FO 


tc 




291 




BEQ 


BCKSPC 


FD34 


C9 


w 




292 




CMP 


• »98 


FDS6 


FO 


DA 




293 




BEG 


CANCEL 


FD5B 


EO 


= 6 




294 




CPX 


• »F8 


FD5A 


90 


03 




293 




BCC 


NCJTCR 1 


FD3C 


30 


3A 


FF 


296 




JSR 


BELL 


FDSF 


EG 






297 


NOTCH 1 


I NX 




FD60 


:■■; 


13 




298 




BNE 


NXTCHAR 


FD62 


-■■■ 


DC 




299 


CANCEL 


LDA 


••DC 


FD64 


20 


CD 


Ft 


300 




JSR 


COUT 


FD67 


l'- 


BE 


FO 


301 


GETLNZ 


JSR 


CROUT 


FD6A 


A3 


33 




302 


CETLN 


LDA 


PROMPT 


FD6C 


20 


EO 


FD 


303 




JSR 


COUT 


FD6F 


A2 


o: 




304 




LDX 


■•01 


FD7 1 


EM 






305 


BCKSPC 


TXA 




FD72 


FO 


F3 




306 




BEQ 


GETLNZ 


FD74 


CA 






307 




DEX 




FD75 


20 


2^ 


FD 


308 


NXTCHAR 


JSR 


RDCHAR 


FD78 


C9 


*: 




309 




CMP 


• •95 


FD7A 


DO 


02 




310 




BNE 


CAPTST 


FD7C 


Bl 


2E 




311 




LDA 


< BASL 1 . 


FD7E 


M 


EO 




312 


CAPTST 


CMP 


• ■EO 


FDBO 


90 


02 




313 




BCC 


ADDINP 


FDB2 


z~ 


DF 




314 




AND 


• »DF 


FD84 


9D 


DC 


02 


313 


ADD1NP 


STA 


IN. X 


FDB7 


C9 


s: 




316 




CMP 


• •BD 


FDB9 


:■'. 


BE 




317 




BNE 


NOTCR 


FDBB 


20 


9C 


PC 


31B 




JSR 


CLREOL 


FDBE 


t-~ 


BD 




319 


CROUT 


LDA 


■•BD 


FD90 


DO 


SB 




320 




BNE 


COUT 


FD92 


A4 


3D 




321 


PRA] 


LDV 


A1H 


FD94 


M. 


3C 




322 




LDX 


AIL 


FD96 


20 


BE 


FD 


323 


PRYX2 


JSR 


CROUT 


FD99 


BO 


4C 


P9 


324 




JSR 


PRNTYX 


FD9C 


A( 


DO 




325 




LDV 


"•00 


FD9E 


A9 


•-.I 




326 




LDA 


• •AD 


FDAO 


-~ 


ED 


FD 


327 




JMP 


COUT 


FDA2 








328 




PACE 


^DA2 


A3 


-: 




329 


XAMG 


LDA 


AIL 


FDAS 


09 


07 




330 




OR A 


••07 


FDA7 


B5 


3E 




331 




STA 


A2L 


FDA9 


AS 


3D 




332 




LDA 


AIM 


FDAB 


B9 


3F 




333 




STA 


ASH 


FDAD 


A3 


30 




33^ 


M0D8CHK 


LDA 


AIL 


FDAF 


?--'- 


07 




333 




AND 


• •07 


FDB1 


DO 


03 




336 




BNE 


DATAOUT 


FDB3 


20 


92 


FD 


337 


XAM 


JSR 


PRA1 


FDB6 


A9 


At 




338 


DATAOUT 


LDA 


• •AO 


FDBB 


20 


l: 


FD 


339 




JSR 


COUT 


FDBB. 


BI 


3C 




340 




LDA 


(AIL). Y 


FDBD 


20 


DA 


FD 


341 




JSR 


PR BYTE 


FDCO 


; o 


BA 


FC 


342 




JSR 


NXTA1 


FDC3 


90 


ES 




343 




BCC 


MODBCHH 


FDC5 


60 






344 


RTS4C 


RTB 




FDC6 


4 A 






343 


XAMPM 


LSR 


A 


FDC7 


=C 


EA 




34ft 




BCC 


XAM 


FDC9 


4A 






347 




LSR 


A 


FDCA 


4A 






34B 




LSR 


A 


FDCB 


AS 


3E 




349 




LDA 


A2L 


FDCD 


90 


02 




330 




BCC 


ADD 


FDCF 


49 


ff 




331 




EOR 


• •FF 


FDD1 


65 


3Z 




352 


ADD 


ADC 


AIL 


FDD3 


48 






353 




PHA 




FDD* 


AQ 


BD 




354 




LDA 


••BD 


FDD6 


20 


EO 


F^ 


333 




JSR 


COUT 


FDD9 


6B 






356 




PLA 




FDDA 


46 






337 


PRBVTE 


PHA 




FDDB 


4A 






3 SB 




LSR 


A 


FDDC 


«* 






339 




LSR 


A 


FDDD 


4A 






360 




L5R 


A 


FDDE 


4A 






361 




LSR 


A 



SHIFT TO UPPER CASE 



149 



FDDF 


20 


E5 


FD 


362 




JSR 


PRHEXZ 


FDE2 


6B 






363 




PL A 




FDE3 


29 


OF 




364 


PRHEX 


AND 


««0F 


FDE5 


09 


a a 




363 


PflHEXZ 


ORA 


• SB0 


FDE7 


C9 


BA 




3o6 




CMP 


**BA 


FDE9 


90 


02 




367 




DCC 


COUT 


FDEB 


69 


06 




36B 




ADC 


•*06 


FDED 


6C 


36 


00 


369 


COUT 


JMP 


(C5WL> 


FDFO 


C9 


AO 




370 


C0UT1 


CMP 


• SAO 


FDF2 


90 


OS 




371 




BCC 


COUTZ 


FDF4 


25 


32 




372 




AND 


INVFLC 


FDF6 


94 


33 




373 


COUTZ 


STY 


YSAV1 


FDFe 


4B 






374 




PMA 




FDF9 


20 


7B 


FB 


373 




JSR 


V I DWA I T 


FDFC 


66 






376 




PLA 




FDFD 


A* 


3fl 




377 




LDV 


YSAV1 


FDFF 


60 






376 




RTS 




FEOO 








379 




PAOE 


FEOO 


C6 


34 




3B0 


BL1 


DEC 


VSAV 


FE02 


FO 


9F 




381 




CEO 


XAMB 


FE04 


CA 






382 


BLANK 


DEX 




FE03 


DO 


16 




383 




BNE 


SETMDZ 


FE07 


C9 


BA 




384 




CMP 


HS8A 


FE09 


DO 


BE 




383 




BNE 


XAMPM 


FEOB 


99 


;: 




386 


STOR 


STA 


MODE 


FEOD: 


AS 


IE 




3B7 




LDA 


A2L 


FEOF 


91 


40 




388 




STA 


( A3L ) . V 


FEI 1 


E6 


40 




389 




INC 


A3L 


FE13 


DO 


02 




390 




BNE 


RTS5 


FE13 


E6 


41 




39 1 




INC 


A3M 


FEI 7 


60 






392 


RTS5 


RTS 




FE1B 


A4 


34 




393 


SETMODE 


LDV 


YSAV 


FEI A 


09 


FF 


Dl 


394 




LDA 


IN-1. Y 


FElO 


S3 


31 




393 


5ETWDZ 


STA 


MODE 


FE1F 


60 






396 




RTS 




FEZO 


A2 


01 




397 


LT 


LDX 


■ SOI 


FE22 


B3 


3E 




39 B 


LT2 


LDA 


A2L. X 


FE24. 


93 


42 




399 




STA 


A4L, X 


FE26 


93 


44 




400 




STA 


ASL. X 


FE2B 


CA 






401 




DEX 




FE29 


10 


F7 




402 




3PL 


LT2 


FE2B 


60 






403 




RTS 




FE2C 


31 


3C 




404 


MOVE 


LDA 


(AIL*. Y 


FE2E 


91 


42 




405 




STA 


(A4L). Y 


FE30 


20 


B4 


FC 


406 




JSR 


NXTA4 


FE33 


90 


F7 




407 




BCC 


MOVE 


FE35 


60 






40B 




RTS 




FE36 


ai 


3C 




409 


VFY 


LDA 


(AID. V 


FE3B 


Dl 


42 




410 




CMP 


(A4LI. V 


FE3A 


FO 


1C 




■»1 1 




BEQ 


VFYOK 


FE3C 


20 


92 


PC 


412 




JSR 


PRA1 


FE3F 


Bl 


3C 




413 




LDA 


(AIL). Y 


FE41 


20 


DA 


FD 


414 




JSR 


PRBYTE 


FE44 


A9 


AO 




413 




LDA 


»»aO 


FE46 


20 


ED 


FO 


416 




JSR 


COUT 


FE49 


A9 


AB 




417 




LDA 


»*A8 


FE4B 


20 


ED 


FD 


41B 




JSR 


COUT 


FE4E 


Bl 


42 




419 




LDA 


CA4LK v 


FE50 


20 


DA 


FD 


420 




JSR 


PRBYTE 


FE53 




A9 




421 




LDA 


»*A9 


FE55 


20 


ED 


FD 


422 




JSR 


COUT 


FESB 


20 


D4 


FF 


423 


VFYOK 


JSR 


NXTA4 


FE3B 


90 


D9 




424 




BCC 


VFY 


FE3D 


60 






423 




RTS 




FE5E 


20 


75 


FE 


426 


LIST 


JSR 


A1PC 


FE61 


A9 


14 




427 




LDA 


**14 


FE63 


48 






42B 


LIST2 


PHA 




FE64 


30 


CO 


-•3 


429 




JSR 


INSTDSP 


FE67 


20 


33 


F9 


430 




JSR 


PCADJ 


FE6A 


83 


3A 




431 




STA 


PCL 


PE6C 


64 


38 




4 32 




STV 


PCH 


FE6E 


68 






433 




PLA 




FE6F 


38 






434 




SEC 





CD CHECK FDR PAUSE 



1 50 



FE70 


E9 


31 




435 




3DC 


• •01 




TE72 


DO 


EF 




436 




BNE 


l:?t? 




FE74 


60 






437 




PTS 






FE75 








43C- 




PACE 




FE75 


BA 






439 


A1PC 


TXA 






FE76 


FO 


07 




440 




BEO 


A1PCRTS 




-E76 


D? 


3C 




44] 


A1PCLP 


LDA 


AIL. X 




FE7A 


95 


SA 




442 




STA 


PCL. X 




FE7C 


ZA 






44 3 




DEX 






FE7D 


10 


f~ 




444 




gpL 


A1PCLP 




FE7F 


60 






445 


A1PCFTS 


RT5 






FEBO 


AO 


? r 




446 


SETINV 


LDV 


*«3F 




FEB? 


DO 


OS 




447 




ONE 


SET1FLG 




FEB* 


AO 


pp 




448 


BETNORM 


LDV 


••FF 




FEBo 


-^ 


32 




.:.: . 


SETIFLO 


STY 


INVFLG 




FE89 


60 






450 




RTS 






FE89 


A9 


DC 




451 


SETKDD 


LDA 


woo 




FE8B 


B5 


3E 




452 


INPORT 


STA 


A2L 




FE8D 


A? 


33 




453 


INPRT 


LDV 


•KSWL 




FEBF 


AO 


11 




454 




LDY 


•KEVIN 




FE91 


DO 


08 




455 




ONE 


ioprt 




FE93 


A9 


00 




4 56 


SETV1D 


LDA 


■ •00 




FE95 


85 


3£ 




457 


OUTPORT 


3TA 


A2L 




FE97 


A? 


3* 




458 


OUTPRT 


LDX 


•CSWL 




FE99 


AO 


FO 




45* 




LDV 


•COUT I 




FE9B 


A5 


3E 




460 


IDPRT 


LDA 


A2L 




FE9D 


29 


OF 




461 




AND 


••OF 




FE9F 


FO 


06 




462 




BEQ 


I0PRT1 




FEA1 


09 


CO 




463 




OR A 


•IOADR'256 




FEA3 


AO 


00 




4^4 




LDV 


• •00 




FEA5 


FO 


OS 




465 




BEQ 


I0PRT5 




FEA7 


A9 


FD 




466 


10PRT1 


LDA 


•COUT 1/256 




FEA9 








467 


IDPRT2 


EGU 


» 




FEA9 


9* 


00 




468 




STY 


LOCO- X . «94. *00 




FEAB 


95 


: 




469 




5TA 


LOCI. X , »95. *0l 




FEAD 


60 






470 




RTS 






FEAE 


EA 






471 




NOP 






FEAF 


EA 






472 




NOP 






FEDO 


4C 


00 


EC 


473 


VBASIC 


jnp 


BASIC 




FEB3 


4C 


03 


EC 


474 


BA5C0NT 


JHP 


DASIC2 




FEB6 


20 


78 


rr 


475 


00 


J5R 


AIPC 




FEB9 


20 


3F 


FT 


476 




JBR 


RESTORE 




FEBC 


6C 


3A 


□ 


477 




JMP 


(PCLI 




FEBF 


4C 


D7 


FA 


47B 


REGZ 


JMP 


REGDSP 




FECI 


60 






479 


TRACE 


RTS 






FEC3 








480 


* TRACE 


15 CONE 




FEC3 


EA 






481 




NOP 






FEC4 


60 






4B2 


STEP 2 


RTS 


« STEP IS 


OONE 


FEC5 


EA 






483 




NOP 






FEC6 


EA 






484 




NOP 






FEC7: 


EA 






4SS 




NOP 






FECB 


EA 






486 




NOP 






FEC9 


EA 






487 




NOP 






FECA 


4C 


F8 


03 


4B8 


UBR 


JMP 


UBR AD* 




FECD 








489 




PACE 




FECD 


A9 


-L 




490 


WRITE 


LDA 


••40 




FECF 


20 


: c 


F( 


401 




JSR 


HEADR 




FED2 


AO 


27 




492 




LDV 


• •27 




FED4 


A2 


00 




493 


WRI 


LDX 


• •00 




FED6 


41 


3C 




•194 




EO* 


(AIL, X) 




FEDB 


«8 






495 




PHA 






FED9 


Al 


X 




ZPb 




LDA 


(AIL. X) 




FEDB 


SC 


ED 


FL 


497 




JSR 


WRBVTE 




FEDE 


20 


BA 


f-:. 


498 




JSR 


NXTA1 




FEE1 


AO 


1D 




490 




LDV 


•SID 




FEE3 


66 






500 




PLA 






FEE 4 


90 


EE 




501 




BCC 


wri 




FEE6 


AO 


?r 




502 




LOV 


••22 




FEES 


2C 


EI 


F£ 


503 




JSR 


WRBVTE 




FEED 


FO 


•".[ 




504 




BEQ 


BELL 




FEED 


a; 


i( 




505 


MR BYTE 


LDX 


••10 




FEEF 


OA 






506 


WRBVT2 


ASL 


A 




FEFO 


20 


!■: 


f; 


507 




JSR 


WRBIT 





151 



FEF3 


DO Ft. 


50B 




BNE WRBYT2 


FEF5 


60 


509 




RT5 


FEF6 


20 00 FE 


510 CRKON 


JSR BL1 


FEF9 


68 


511 




PLA 


FEFA 


68 


512 




PLA 


FEFD 


DO 6C 


513 




BNE "ON 2 


FEFD 


20 FA FC 


514 READ 


JSR RD2BIT 


FFOO 


A9 16 


515 




LDA 1**16 


FF02 


20 C9 FC 


516 




JSR HE ADR 


FF05 


85 2E 


517 




STA CMKSUn 


FF07 


20 FA FC 


518 




JSR RD28IT 


FFOA 


AO 24 


319 RD2 


LDV *S24 


FFOC 


20 FD FC 


320 




JSR RDDIT 


FFOF 


BO F9 


521 




BCS RD2 


FFU 


20 FD FC 


32£ 




JSR RDBIT 


FF14 


AO 38 


323 




LDV »*3B 


FF16 


20 EC FC 


524 RD3 


JSR RDBVTE 


FF19 


81 3C 


525 




STA (AIL. X) 


FFIB 


43 2E 


526 




EOR CHKSUH 


FF1D 


95 2E 


327 




STA CHKSUM 


FF1F 


20 BA FC 


32B 




JSR NXTA1 


FF22 


AO 35 


529 




LDV M35 


FF24 


90 FO 


530 




BCC RD3 


FF26 


20 EC FC 


531 




JSR RDBYTE 


FF29 


C3 2E 


532 




CMP CHKSUH 


FF2B 


FO OD 


533 




BEQ BELL 


FF2D 


A9 C5 


334 


PRERR 


LDA #»C5 


FF2F 


20 ED FD 


535 




JSR COUT 


FF32 


A9 D2 


536 




LDA ««D2 


FF34 


20 ED FD 


537 




JSR COUT 


FF37 


20 ED FD 


336 




JSR COUT 


FF3A 


A9 B7 


539 


BELL 


LDA •»B7 


FF3C 


4C ED FD 


540 




JMP COUT 


FF3F 




54 1 




PACE 


Fr 3 F 


A5 48 


342 


RESTORE LDA STATU 


FF«1 


48 


543 




PHA 


FF42 


A5 45 


544 




LDA A5H 


FF44 


At, 4 c 


545 


RESTR1 


LDX XREC 


FF4fi 


A4 47 


54 b 




LDV VREC 


FF4B 


26 


547 




PLP 


FF49 


60 


348 




RTS 


FF4A 


85 45 


?4Q 


5AVE 


5TA A5H 


FF4C 


86 46 


550 


5AV1 


STX XREO 


FF4E 


84 47 


551 




STV YREC 


FF30 


08 


352 




PMP 


FF51 


68 


553 




PLA 


FF52 


S5 48 


554 




STA STATU5 


FF54 


BA 


555 




TSX 


FF35 


86 49 


556 




STX SPKT 


FF57 


D8 


357 




CLD 


FF58 


60 


556 




RTS 


FF59 


20 B4 FE 


559 


OLDRST 


JSR SETNORM 


FF3C 


20 2F FB 


360 




JSR I NIT 


FF5F 


2C 93 FE 


361 




JSR SETVID 


FF62 


20 89 FE 


562 




JSR SETKBD 


FF63 




563 




PACE 


FF65 


DC 


564 


MOM 


CLD 


FF&6 


20 3A FF 


565 




JSR BELL 


FF69 


A9 AA 


566 


MONZ 


LDA *»AA 


FF6B 


85 33 


567 




STA PROMPT 


FF6D 


20 67 FD 


568 




jsr cetln; 


FF70 


20 C7 FF 


369 




JSR ZMODE 


FF73 


20 A7 FF 


570 


NXTITM 


J5R GETNUM 


FF76 


84 34 


371 




STV VSAV 


FF7S 


AO 17 


372 




LDV »«I7 


FF7A 


88 


373 


CHRSRCM 


FF7B 


30 EB 


S7J 




BMI MON 


FF7D 


D9 CC FF 


575 




CMP CHRTBL. 


FF80 


DO FE 


576 




BNE CHRSRCM 


FFB2 


20 BE FF 


57' 




JSR TQSUS 


FFB5 


A4 34 


578 




LDV VSAV 


FFB7 


AC 73 FF 


379 




JMP NXTITM 


FFBA 


A2 03 


390 


DIG 


LDX M03 



152 



-a 






FFBC 


DA 




5B1 




A5L 


A 




FFBD 


DA 




382 




ASL 


A 




FFBE 


.-.,. 




3B3 




ASL 


A 




FF8F 


OA 




564 




ASL 


A 




FF90 


DA 




583 


NXTBIT 


ASL 


A 




FF91 


21 


JL 


586 




ROL 


A2L 




FF93 


Tt 


:•- 


38? 




ROL 


A2H 




FF95 


-■- 




386 




DEX 






FF96 


10 


^e 


589 




BPL 


NXTBIT 




FF9B 


A5 


31 


590 


NXTBAS 


LDA 


MODE 




FF9A 


□c 


Dfi 


591 




8NE 


NXTBS2 




FF9C 






392 


1 








FF9C 


BS 


3F 


393 




LDA 


A2M. X 




FF9E 






394 


- 








FF9E 


93 


:u. 


395 




STA 


AIM, X 




FFAO 






596 


• 








FFAO 


9: 


41 


597 




STA 


A3- i 




FT A3 


EE 




59B 


NXTBS2 


IN* 






FFA3 


FO 


Fn 


399 




BEO 


NXTBA5 




FFA5 


DC 


--■ 


600 




BNE 


NXTCHR 




FFA7 


A2 


DO 


601 


GETNUfl 


LDX 


■ *00 




FFA9 


Be 


3t 


60? 




STX 


A2L 




FFAfl 


Bt 


3F 


603 




BTX 


A2H 




FFAD 


B? 


oo or 


604 


NXTCHR 


LDA 


IN, V 




FFBO 


CB 




605 




I NY 






FFB1 


49 


BO 


606 




EOR 


MftBO 




FFD3 


CH 


M 


607 




CMP 


■ •OA 




FFB5 


9C 


03 


60S 




BCC 


DIG 




FF87 


M 


Be 


609 




ADC 


■ •B8 




FF09 


C9 


FA 


610 




CMP 


■ *FA 




FFBD 


BC 


CI 


611 




BCS 


DIG 




FFBD 


60 




6ir 




RTS 






FFBE 


A9 


PE- 


613 


TOSUB 


LDA 


■00/236 




FFCO 


48 




614 




PHA 






FFC1 


r,~- 


ES FF 


615 




LDA 


SUBTBL, V 




FFCfl 


U 




616 




PMA 






FFC5 


A3 


31 


617 




LDA 


MODE 




FFC7 


M 


00 


MB 


MODE 


LDV 


«*00 




FFC9 


■-- 


:•: 


619 




STV 


MODE 




FFCB 


60 




620 




RTS 






FFCC 






621 




PACE 




FFCC 


BC 




622 


CHRTBL 


DFB 


•BC 




FFCD 


BS 




623 




DFB 


«B2 




FFCE 


BE 




624 




DFB 


•BE 




FFCF 


B2 




625 




DFB 


•B2 


T CMD NOW LIKE UBR 


FFDO 


EF 




62c 




DFB 


•EF 




FFD1 






627 




DFB 


•C4 




FFD2 


Bi 




62B 




D1 B 


*B2 


5 CMD NOW LIKE USR 


FFD3 


A9 




62 = 




DFB 


•A9 




FFD4 


Bt 




630 




DFB 


SBB 




FFD5 


Ac 




631 




DFB 


•A6 




FFD6 


A4 




632 




DFD 


• A4 




FFD7 


06 




633 




DFB 


• 06 




FFDB 


?! 




634 




DFB 


•95 




FFD9 


07 




633 




DFB 


• 07 




FFDA 


oc 




636 




DFB 


•02 




FFDB 


03 




637 




DFB 


•05 




FFDC 


FC 




63S 




DFB 


•FO 




FFDD 


DC 




63° 




DFB 


•00 




FFDE 


EB 




640 




DFB 


•EB 




FFDF 


93 




64: 




DFB 


•93 




FFEO 


-"■ 




642 




DFB 


*a- 




FFE1 


C6 




643 




DFB 


*C6 




FFE2 


9q 




J4 




DFB 


• 99 




FFE3 


:: 




64 5 


SUBTBL 


DFB 


• B2 




FFE4 


C9 




646 




DFB 


«C9 




FFE5 


BE 




647 




DFB 


• BE 




FFE6 


CI 




t - B 




DFB 


*C1 




FFE' 


38 




649 




DFB 


• 35 




FFEB 


BC 




650 




DFB 


•BC 




FFE9 


C« 




631 




DFB 


• C4 




FFEA 


96 




652 




DFB 


•96 




FFEB 


AF 




653 




DFB 


•AF 





153 



FFEC: 


17 




65* 


DFD 


• 17 


FFED 


17 




655 


DFD 


*17 


FFEE 


SB 




65e 


DFB 


*2D 


FFEF 


IF 




657 


DFE 


*1F 


FFFG 


B3 




658 


DFB 


*B3 


FFF1 


7F 




650 


DFB 


«7F 


FFF2 


5D 




660 


DFB 


»5D 


FFF3 


CC 




661 


DFB 


• CC 


FFF* 


05 




662 


DFB 


• 05 


FFF5 


FC 




663 


DPS 


*FC 


FFF6 


17 




664 


DFB 


• 17 


FFF7 


n 




665 


DFB 


• 17 


FFFB 


F5 




666 


DFB 


*F5 


PFF" 


03 




667 


DFQ 


•03 


FFFA 


FD 


D9 


60S 


DU 


NMI 


FFFC 


62 


FA 


66** 


DM 


RESET 


FFFE 


«0 


Tm 


670 


DU 


IRQ 



ft 



ENDASK — 



154 



MONITOR ROM LISTING 



2 


« 






• 


i 


• 


APPLE 


IX 


• 


i 


i 


. . . ': ICMITOB 


• 


b 


* 


. 


• 


■ 


d 
) 


APPLE COHPUTER, 

■ 


• 


ALL 




1 . . 


> 


Li 


• 






- 


LJ 


■ 


( 


• 


-- 


• 


"AUM 


• 




■ 






• 




■ 






la 


- 




SuO 






: 


EPZ 


. 




. 




. 


520 




I • 


■ ■ 


- 






- 


' 


. 








■ 




S23 








tPZ 


1 




2: 


■ 




525 




; 


GSASL 


' ■ 


526 




-3 


GBA6H 




52/ 




It 


9ASL 




■ 




2 i 


3ASH 








- 


3Aa2L 


EPZ 










EPZ 


i2B 




Ju 


i: 


EPZ 


- 






:. ■■ ■ ■ 


EPZ 


. 




52 




1 


S2C 




-3 










. 1 




EP2 






: 




EPZ 


21 




.0 


MASK 


EPZ 


.- 






■ 


1 


. 




ie 


- ■ 


£PZ 


S2E 




■ 


. ■ 


1 


: 




- . 


■ 








*l 


. ■ 




52F 




\i 


■ ■ 




531) 




i 


,tCDE 


■ 


: 




.» 


. 


EPZ 


. 




« 5 




EPZ 






• 


- ■ ■ 


lP^ 


5i4 




•; i 


¥i<Wl 




535 




- 




EPZ 


Sib 




; • 




EPS 






5u 


- 








SI 


■ 


■ 


■ 




•j - 


PCL 


EPZ 


S3A 








. 


S3a 




i 




:. : .. 


■ 




55 


■ 




- 






Alii 


fcFZ 






. 


\ZL 


EPZ 


5JE 






,2U 


: 


53F 




.-.< 


. 


EPZ 


S40 




dJ 


\'M 


EPZ 


MI 




61 


ML 


El . 


. :. 




. 




EPZ 


: 1 ■ 




6J 


ASL 


. 






.■ 


ASH 


EPZ 


1 




'. : 


ACC 


■ 


•: 




bD 


XREG 


EPZ 


546 




U | 


VREG 


EPZ 


• 




6fl 


■ 


EPZ 


1 1 





-APPLE I I SYSTEM "-: ■ 



155 









69 


SPNT 


EPZ 


549 










7U 


RNDL 


EPZ 


S4t 










71 


RNDH 


EPZ 


,AV 










72 


ACL 


epz 


S50 










73 


ACB 


EPZ 


551 










'•1 


XTNCL 


BH 


S52 










75 


XTNDH 


EPZ 


553 










1 o 


AUXL 


EPZ 


$54 










77 


AUXli 


EPZ 


355 










7o 


PICK 


EPZ 


595 










)9 


IN 


ECU 


$0200 










Bit 


; S B A E t 


ECU 


503Fc 










dl 


NNI 


EOU 


5J3FB 










82 


IRQLOC 


ECU 


503FE 










B3 


IOADH 


ECU 


5C0OU 










iA 


K3D 


ECU 


SCOUQ 










a ; 


kqcj:bb 


ECU 


5C010 










Bti 


"APEOUT 


EQU 


SC020 










d7 


SPKR 


ECU 












Ha 


TXTCLR 


ECU 


5C-j5l 










d9 


TXT5ET 


ECU 


SC051 










*o 


M1XCLR 


ECU 


5CU52 










>] 


M1XSET 


ECU 


SC053 










92 


LOW SCR 


ECU 


5C054 










93 


HISCfl 


ECU 


SC055 










J4 


LCRES 


ECU 


SCU56 










95 


HIRES 


ECU 












9b 


TAPE IN 


ECU 












97 


PADOLO 


ECU 


*C064 










90 


PTRIG 


ECU 


SCU/d 










>9 


ihS :c 


ECU 


5EOO0 












BASIC 2 


sou 


SE003 










Ul 




CflC 


3P8'J0 


. \t : KDtH ESS 


FcUu 


iA 




Lu2 


■ 


LSR 


A 


Y-COOBI 


Foul 


ud 




Ljj 




PHP 




SAVE L3B IN JAHRY 


Fo02i 


2u 


1 i 


Fa lu4 




jsr 


GBASCALC 


a AGE ACfl .:• .:- \-i, b 


Fa " 5 


2d 




105 




PLP 




RESTORE -LS3 FRCM CARRY 


Fd06 


A9 


JP 


LU6 




LDA 


|S<3F 


-OF IP EVES 


: 


ad 


U2 


107 




BCC 


RTHASK 




FouA 


69 


Cu 


lUd 




ADC 


»seo 


■1ASK SFu '.? ODD 


FdOC 


85 


2E 


109 


RTHASK 


STA 


MASK 




F30E 


Bl 


26 


UU 


PLOTl 


LDA 


(GBA3L) , Y 


DATA 


FdlQ 


45 


30 


111 




EOR 


COLOR 


XOR COLOR 


FS12 


25 


2E 


112 




AND 


MASK 


AND MASK 


F614 


51 


26 


113 




EOR 


(GBASL) ,Y 


XOR DATA 


Fclti 


91 


2a 


i 14 




STA 


(GBA5L) . Y 


TO DATA 


F61d 


U 




115 




RTS 






Fdl9 


20 


Uu 


FB 116 


HLINE 


J5R 


PLOT 


PLOT SQUARE 


FblC 


C4 


2C 


117 


HL1NE1 


CPY 


B2 


DONE? 


F31E 


BO 


11 


118 




BCS 


RTSl 


YES, RETURN 


F82C 


C8 




119 




1NY 




NO, 1NCR INOEX (X-COORD) 


P821 


20 


OE 


PB 120 




J5R 


PLOTl 


PLOT NEXT 5CUARE 


Fe24 


90 


Fb 


121 




BCC 


HLINE1 


ALWAYS TAKEN 


F826 


69 


01 


122 


VLINEZ 


ADC 


IS01 


NEXT Y-COORD 


fh:o 


48 




123 


VLINE 


PHA 




SAVE ON STACK 


Fri29 


20 


JO 


Ffl 124 




JSR 


PLOT 


PLOT SQUARE 


F82C 


68 




125 




PLA 






Fo2u 


C5 


2D 


126 




CMP 


V2 


DONE? 


F62P 


90 


F5 


127 




BCC 


VLINEZ 


NO, LOOP. 


Fd31 


bo 




i2b 


RT51 


PIS 






Fd32 


Au 


2F 


129 


CLR SCR 


LDY 


• 52F 


MAX Y, FULL 5CRN CLR 


F834 


DO 


02 


130 




BNE 


CLRSC2 


ALWAYS TAKEN 


F836 


AO 


27 


131 


CLRTOP 


LDY 


• 527 


MAX Y, TOP SCRN CLR 


Fdja 


84 


2D 


132 


CLRSC2 


STY 


V2 


STORE AS BOTTOM COORD 








133 


* 




FOR 


VLINE CALLS 


Pd3A 


Au 


27 


134 




LDY 


1527 


RIGHTMOST X-COORD (COLUMt* 


PQ « 


A9 


OD 


135 


CLRSC3 


LDA 


ISO 


TOP COORD FOR VLINE CALLS 


F83E 


85 


30 


136 




STA 


COLOB 


CLEAR COLOR (BLACK) 


FdJO 


20 


28 


F8 137 




JSR 


VLINE 


DRAW VLINE 


Fd43 


88 




138 




DEY 




NEXT LEFTMOST X-COOHD 


FB44 


10 


F6 


139 




3PL 


CLRSC3 


LOOP UNTIL DONE. 


Fd46 


60 




140 




RTS 






- ■ . .' 


4H 




141 


G8ASCALC 


PHA 




FOR INPUT 000DEFGH 


Ffi4d 


4A 




142 




L5R 


a 





Sfi 



F849 


29 03 


1 43 




AND 


ISG3 


F643 


09 U 4 


144 




OBA 


*S04 


F64D 


85 27 


145 




STA 


GBASH 


F84F 


6B 


146 




PLA 




F85U 


29 U 


147 




AND 


1511 


F852 


90 02 


1 4a 




BCC 


GBCALC 


F8S4 


69 7F 


149 




ADC 


(S7F 


Fass 


85 26 


15U 


QBCALC 


STA 


GBASL 


Fein 


UA 


151 




ASL 


A 


Fob9 


OA 


152 




ASL 


A 


F65A 


U5 26 


153 




ORA 


GBASL 


F85C 


cS 26 


154 




STA 


GBASL 


F6=E 


bu 


155 




RTS 




Fo;F 


A5 3u 


156 


HXTCOL 


LDA 


COLOR 


Fob! 


lb 


157 




CLC 




Fd62 


69 U 3 


158 




ADC 


4S03 


F664 


t 29 OF 


159 


3ETCOL 


AND 


»SQF 


F866 


E ^5 1U 


16U 




STA 


COLOR 


Food 


UA 


Id: 




ASL 


A 


F869 


: UA 


162 




ASL 


A 


F86A 


UA 


163 




ASL 


A 


F86B 


vA 


164 




ASL 


A 


FbbC 


: US 30 


165 




CRA 


COLOR 


fct'.L 


: OS 30 


ioo 




STA 


COLOR 


Fu7« 


: 6U 


167 




RTS 




FbU 


: 4A 


166 


SCRS 


LSfl 


A 


FtJ72 


: Uo 


169 




PHP 




F873 


; ZU 47 


Ffl 1 70 




JSR 


GBASCALC 


FB76 


: Bl 26 


171 




LDA 


(GBASLl ,Y 


F87IJ 


: 2o 


172 




PLP 




Fd/9 


i 90 04 


17J 


3CHN2 


BCC 


RTMSK2 


FOVB 


: 4A 


174 




LSR 


A 


FU7C 


: 4A 


175 




LSR 


A 


Fa7D 


: 4A 


176 




LSR 


A 


P8 7E 


4A 


177 




LSR 


A 


Fd7F 


: 29 JF 


17b 


RTMSKZ 


AMD 


JSUF 


FbdX 


: 6U 


179 




HTS 




F8o2 


1 A6 3A 


188 


INSDS1 


LDX 


PCL 


Fb84 


: A 4 33 


■ 




LDY 


PCH 


Fdbb 


: 2U So 


p d is: 




JSR 


PRYX2 


F8S9 


: 20 4 6 


F9 183 




JSR 


PRBLtIK 


FdBC 


: Al 3A 


184 




LDA 


<PCL,X) 


Faas 


: Ao 


185 


INSD32 


TAY 




FbdF 


: 4A 


186 




LSR 


A 


Fd*L 


: 9U 09 


187 




acc 


I EVEN 


F892 


; oA 


18d 




ROR 


A 


FA*} 


: Bu Ifl 


189 




BCS 


ERR 


Fa-ii 


: C5 A2 


19U 




CMP 


*SA2 


Fd9" 


: FO UC 


191 




BEG 


ERR 


■ ■ ■ 


: 29 8 7 


192 




AND 


IS87 


Fojc 


: 4A 


193 


I EVEN 


LSR 


A 


PBSi 


: AA 


194 




TAX 




Fb9t 


i BD 62 


F9 195 




LDA 


FMT1.X 


p B ft 


: 2U 79 


Fo 196 




JSR 


SCRN2 


F6A 


: DU 04 


197 




BNE 


GETPMT 


FC" 


i AU 3U 


198 


ERR 


LDY 


iSdO 


FbA 


: A 9 uu 


199 




LDA 


■ 50 


FbA 


: AA 


280 


GETFMT 


TAX 




F8A 


U BD Ab 


F9 201 




LDA 


PHTZ.Jt 


F8A 


3: 85 2E 


202 




STA 


FORMAT 


FbA 


•i 29 U3 


2<J'i 




AND 


6*03 






2U4 


• 




P-l BYTE, 1 


FdB 


L; 85 2P 


2U5 




STA 


LENGTH 


FoB 


3: 98 


2u6 




TYA 




FdB 


4: 29 dF 


2U7 




AND 


BSdF 


FdB 


6: AA 


203 




TAX 




FSB 


7: 9B 


209 




TVA 




FbB 


3 : A u U 3 


210 




LDY 


fSJJ 


F6B 


\: EJ oA 


211 




cpx 


J56A 


F6B 


:: Fu OB 


212 




BBC 


MNNDX3 


FbB 


E: 4A 


213 


MNNDX1 


L5R 


A 


FbO 


F: 90 Ub 


214 




3CC 


MNNDX3 


FSC 


1: 4A 


215 




LSP 


A 



GENERATE GBASH-00OOU1FG 
AND GBASL-HDEDEO00 



INCREMENT COLOR BY 3 

SETS COLOft«17«A MOD 16 

BOTH HALF BYTES OF COLOR EQUAL 



READ SCREEN Y-CCORD/2 
SAVE LSB (CARRY) 
CAM BASE ADDRESS 
GET BYTE 

RESTORE LSB FRCM CARRY 
It? EVEN. USE LO H 



SHIFT HIGH HALF BYTE DOWN 
MASK 4-BITS 
PRINT FCL, H 



FOLLOWED BY A BLANK 
GET OP CODE 

EVEN/ODD TEST 

BIT 1 TEST 

XXXXXXll INVALID OP 

OPCODE S99 INVALID 

MA5R BITS 

LSB INTO CARRY FOR L/R TEST 

GET FORMAT INDEX BYTE 
R/L H-flYTE ON CARHY 

SUBSTITUTE SOU FCR INVALID OPS 
SET PRINT FORMAT INDEX TO 

INDEX INTO PRINT FORMAT TABLE 
SAVE FOR ADR FIELD FORMATTING 
MASK FOR 2-BIT LENGTH 
• 2 BYTE. 2-3 BCTS) 

OPCODE 

MASK FOP IXXXlOlu IE5T 

SAVE IT 
OPCODE TO A AGAIN 



FORM INDEX INTO MNEMONIC TABLE 



157 



PbC2: 


4 A 




21b' 


MNNDX2 


L5B 


A 


PBC3: 


■ ■ 




21 




DBA 


»S2U 


FcC5: 


nc 








DEY 




FnCo: 


DO FA 




. 1 1 




3ME 


■INNDX2 


FdCti: 


Co 








: ■-. 




■ 


66 




221 


MNSDXJ, 






F6CA: 






222 




FINE 


I'.tfNDXl 


FBCC: 


&fl 




223 




RTS 




FBCD: 


■ 


: 


224 




CFB 


SFF.SPl . 


P6DG: 


. 


Pfl 


225 


1NSTCSP 


JSB 




FHD3: 






226 




PHA 




FdD4: 


Bl 3A 




22? 


PRNTOP 




(PCL) ,Y 


FdDo: 


2U DA 


PO 


22b 




JSR 


PBBYTE 


FBD9: 


A2 Ul 




229 




LDX 


fSttl 


F8D8: 




?s 


2U 


PRNTSL 


JSR 


PRBL3 




:4 2F 




231 




CPY 




rSEUi 


CtJ 








IKY 




FBElt 


90 Fl 




233 




9CC 




■ 


*2 U3 




234 




LDX 


- 


FoE5: 


CU U4 




235 




CFY 


»SU4 


FoE 7: 


9u F2 




23D 




BCC 


■ 


PtJE9l 


oH 




237 




PLA 




F6EA: 


AH 




23b 




TAY 




FtiEB: 


By cu 


P9 


. 




LDA 


MNEML.Y 


Fn£E: 


d5 2C 




24U 






LHNE.H 


PoFO: 


B9 u0 


F h 


241 




LDA 


MNEMB, Y 








Z42 




3TA 


RMNEM 


FoFb: 


Ay JO 




24 i 


PBMVl 


LDA 


«$0U 


MP?: 


AU U5 




244 




LDY 




FbF9: 


Jd 2D 




24 5 


prkn; 


ASL 


RMNEM 


FcFB: 


26 2C 








RGL 


LMNEH 


FoFD: 






247 




ROL 


A 


FoFE: 


b$ 




■ 




DEY 




PdPfi 


DU Fo 




249 




BSE 


PRMN2 


F9U1: 


69 3F 




2iu 




ADC 


*S6F 


F903; 


20 ED 




251 




JSB 


cotra 


F9«6: 






252 




DBX 




P907: 


Do EC 




253 




BNE 


PRMN 1 


FyU9i 


- 


F:' 


2 54 




JSB 






A 4 IF 




;55 




LDY 


LENGTH 


P9JEI 










LDX 


l$0G 


1 


Eu «3 




257 


PRADR1 




«Su3 


F912: 


■ 




25*1 




■ 


. 


F 9 14 1 


utt 2E 




- ■ 


PKADH2 


ASL 


F7SM.M 




9o u£ 




2oJ 




sec 


pradb: 


F9lU: 


BE 33 


p . 


'61 




LDA 


CHARl-l.X 


P9U: 


20 ED 


PO 


262 




JSR 




F91E; 


BC 39 


r - 


263 




LDA 


2-1. X 


PHI i 


. 








3E0 


PBADR3 


F923: 




PC 


265 




iSR 


COUT 


F9Zoi 


CA 




2o6 


PRAOR] 


C£X 




■ 


■ 




- 




3 HE 


PhACRl 




00 








RTS 




F>)2A: 


do 




2o9 


PRADR4 


DEY 




Fy;a = 


. 




2?0 




BHI 


FRADB2 


P92Di 


20 DA 


PE 






JSP 


PRBYTE 


F9JU: 


A5 2E 




272 


PRADR5 


LDA 


FORMAT 


F932: 


C9 EO 








CMP 


- ■ ■ 


P934: 


Bi 3A 




274 




LDA 


IPCLI.Y 


F'i JU : 


. 








BCC 


.- RADR4 


F9Jb: 


■ 


PS 


2 76 


KELADR 


JSB 


PCAD J J 


F93B: 


AA 




277 




TAX 




F93Ct 


Eo 




2i& 




INX 






CL Ul 




. 1 




3NE 


PRNTYX 


F93F: 


Co 




2dU 




INY 










2B1 


PRNTYX 


:ya 




Ps41i 


20 DA 


PI 


id: 


. 


JSR 


PRBYTE 


F944: 


6A 




2oJ 


PHNTX 


rxA 




F945: 


AC DA 


F: 


2tJ4 




JMP 


PRBYTE 


F946: 


. 




2o5 


PRBLNK 


LDX 


■ 


F94A: 


AV AO 




2bb 


PRSL2 


LDA 


(SAO 


F94C: 


20 EO 


FD 287 


PRBL3 


JSB 


COUT 


F94F: 


CA 




2bU 




DEX 





1) lxxxiolu->ouiu:xxx 

2) XXXYYYUl"»uU] liXXX 

XXaYYYH.»''-'.I]10XXX 
4) XXXYYIUuOOUluUXXX 

■::<xxx 



SEN PHI i U 

SAVE rtNEttOHIC 1ABLE INDEX 



PRINT 3 BLAKKS 

3YTES) 
.2 CHB F: : 

4NEI10NIC PRINT 
RECOVER MNEMONIC INDEX 






SHIFT 5 3ITS CP 

CHARACTL 

(CLEARS CARRY) 



ADC "?" OFFSET 
3LTPUT A CHAP -- 



OUTPUT 1 BLANKS 
CUT PCS 

, ADDR. 









HANDLE PEL NOR *OD*: 
SPECIAL (I RGET, 

NOT DFFi; 

PCL.PCHtOFFSET-1 TO A,Y 
-1 TO Y.X 



;UTPUT TARGET ADR 
QP BFANCH AND RETURN 



LOAD A SPA 
OUTPUT A 






1^8 



F95G: 


DU 


F B 




269 




3NE 


phsl: loop until ccunt»o 


F952: 


6U 






290 




1 ■ 




F953: 


J,! 






291 


PCADJ 


£EC 


C=1-3YTE, l*2-BYTE, 


■ ■ 


A5 


2f 




;9^ 


PCADJ 2 


LDA 


LENGTH -3YTE 


P956: 




19 




293 


PCAD.U 


LDY 


PCH 




... 






. ■■; 




TAX 


TE£: . . 


F*59: 


;^ 


-■- 




295 




3 PL 


PCAiiJJ (FCF REL 3RAKCr!> 


F9i3: 


td 










. ■ 1 


EXTESC !«EC BK 




t.5 


SA 




29 V 


PCADJ4 


ADC 


PCL 


■ - 


)(| 






:,o 




BCC 


RTS2 ?CL+LOJG7HlGfl DISPL)«-1 




Cb 










:■-, 


3 Y i PCH) 


■ 








lUi] 


RTS 2 


HTS 












301 


• 


PMT3 


3YTE3: XXXXXXYO INSTBS 










302 


* 


lr " 


• tl TBE1 "LP BYTE 












* 


" 


*1 THEN RIGHT «ALP BYTE 










Jo-; 


• 




INDEX) 


F9o2: 


.1 


- J 


54 










: 


JO 








FMll 


- : i 


504.S2G.S54.5 


F-t67: 


J-l 




1 










1 


U3 


:- 




3^D 




DFB 


>bu, ■ 14 


■ ■ . 


:-i 


-i : 


JO 










F^af : 


DC 


- 




3 J .' 




DFB 


i54,i35 ( SUD, 5 


■ 


i 


.. ; 












■ 


54 


13 








DFB 


-!,S20,i. 


1 ■. - ] 


jli 


- - 


: 










F9 79: 


*• 


1 




303 






5uC,5o 


P573: 


2J 


■: 


;3 










:■ ■ 


uL 


30 




111] 




DFB 


520,554 


F^ou: 


Li 4 


$0 


till 










1 ■ 


. 


44 








DFB 


5J4.S-. 


F9iJ5: 




00 


M 










1 


;, 


tlU 










. : . 


F*oA: 


ll 


-. 


(4 










1 


33 


\}l 








DFB 


! . i44,S 


fbcF : 




., , 


v. 










P9«: 


-i 


- 




314 




[ PB 


SCa,S/44,5A!),$ 




44 


33 


uc 










F*97: 


61/ 


04 




. 




DFB 


$44,1 


F999: 


>0 




:; 










F99C: 


14 


j J 




Jlo 




DFB 


■ . ■ 


: ) • . 


uu 




U4 










F9AI: 


9i 






317 




DFB 


SoD,*ao,so4.s 


• 


2* 


11 


■ 










FHA5: 








;1B 




□ f B 


526.531, $B7*SZ2XXXy01 ; 


■ 


Jd 






- 1 


- 


DFB 


S00 EKR 


PSA 7: 


21 






i 




DFB 


521 IHM 




SI 






321 




DFB 


Z-PAGE 


F*A9: 


■:. 










DFB 


Sb2 ABS 


■' ' ■ 


uo 






323 




DPB 


500 




bj 






324 




DFB 


SUU ACCLI' 


rsACi 


59 






. . ! 




DFB 


559 ' G , X ) 


FSADj 


iL 










>FB 


S4D EpAGJ.Y 


P9AE: 


91 






-- 




DFB 


591 ZPAC.X 


F9AF: 


92 










DFB 


' 


F9QU: 


00 










DFB 


5U6 ABS.Y 


P9B1: 


:■ 










DFB 


54A <A33t 


F9B2j 


J5 






331 




DFB 


IBS ZPAC.Y 


. 


•u 






332 




DFB 


S9D RELA 


i ■ ■ 


AC 


M 












: 


-\i 


Air 


A4 




CHAR1 


A3C 


",j .MS" 




DS 


Jl 












1 


... 


■•■; 


Jw 


1 




CFH 


SD?.- 










JJ5 


•CHAR2: 


" y " . l 


."XSS"^ 














MNEML ! FORM: 










327 




(A» 


XXXXXuOO 










33b 




(B> 


KXXKY100 














(C| 


LXX> 










J-iU 




(D> 


XXX*YYiU 










1 




(El 


XXXY-; . 










342 






■■OEX) 


F9CO: 


: : 


BA 


IC 










F -3C 3 : 


Z3 


. 


H 


34 3 


v.rr-i. 


DFB 


51C.SBA.51C.5 


F9Ct>: 


LB 


■ : 


;.u 











159 



F9C9 


6A 


ID 


23 


344 


CFB 


51B,SA1,S9D 


s 




F9CC 


9D 


.3 


LD 














Al 


uu 


:* 


345 


DFB 


59D. SdB.SlD 


s 




F9D2 


19 


AC 


69 












F9D5 


Aa 


15 




346 


DFB 


519.SAE.S69 


i 




F»Do 


24 


H 


LB 












F9D3 


23 


24 


53 


347 


DFB 


324,553, SIB 


s 




F9DE 


19 


M 




340 


DFB 


S19.SA1 


(A) 


FORMAT *BOVE 


F9Ed 


00 


1A 


SB 












F<jE3 


5B 


'o 


6*1 


J49 


DFB 


51)0, S1A. 553 


5 




F9EG 


24 


-. 




J5u 


DFB 


$24,524 


|S| 


FORMAT 


F9Ed 


AC 


\Z 


*H 












F9EB 


AU 


I* 


JU 


351 


DPS 


5AE.iAE,5Ao 


5 




F*££ 


7C 


dU 




352 


DFB 


S7C,S 


IC1 


FORMAT 


F9PQ 


15 


w 


50 












F9P3 


JC 


AS 


69 


353 


DFB 


S15.59C.S6D 


5 




F9Fo 


2i 


3j 




354 


DFB 


529,553 


ID) 


FORMAT 


F9F6 


84 


ii 


. 4 












F9FB 


11 


*2 


69 


..55 


DFO 


SB4,S13,S34 


s 




F9FE 


23 


■\t 




356 


DFB 


523, 5Au 


IE) 


FORMAT 


FAGu 


Do 


■i .. 


5A 












FA 2 


4B 


j.u 


52 


357 MNEMR 


5Dc.562.S5A 


s 




FAUo 


94 


•a 


54 












FA09 


44 


CO 


54 


J5U 


DFB 


SS4,Sdd,S54 


.- 




FAuC 


66 


44 


Ed 












FAOF 


94 


uu 


94 


359 


DFB 


568,544, SE6 


s 




FA 12 


Od 


14 


74 












FA15 


B4 


26 


BE 


36u 


DFB 


Swo.5d4.574 


5 




FA la 


J4 


F4 


:c 












FAlfl 


4A 


72 


F2 


361 


DFB 


S74,5F4,$CC 


S 




FA IE 


A4 


BA 




362 


DFB 


SA4.S6A 


(A) 


FORMAT 


FA20 


00 


ut 


A2 












FA23 


A2 


■i 


7 4 


3o3 


DFB 


SO0.SAA r SA2 


5 




FA26 


74 


'2 




364 


DFB 


$74,572 


fBJ 


FORMAT 


r'AJd 


44 


68 


; -'- 












FA 28 


J2 


:*- 


-.j 


J65 


DFB 


544,566, SB2 


S 




FA2E 


22 


dU 




36« 


DFB 


522. 5uu 


(C) 


FORMAT 


FA JO 


1A 


1A 


26 












FA33 


26 


72 


'2 


367 


DFB 


31A,5IA,S2ti 


s 




FA35 


06 


ca 




3bb 


DFB 


5J8,5Cd 


(01 


FORMAT 


FAid 


C4 


CA 


2t 












FA ja 


40 


44 


■;■; 


369 


DFB 


SC4.SCA.S26 


s 




FA3E 


\. 






370 


DFB 


SA2.5CB 


(CI 


FORMAT 


FA4v> 


PF 


FF 


PP 


371 


DFB 


SPP,5FF,SFF 






FA4 3 


20 


DO 


pa 


J 72 STEP 


JSR 


:nstdsp 


DISASSEMBLE ONE 


FA46 


o& 






373 


PLA 




AT (PCL,H) 


FA4 7 


as 


2C 




374 


STA 


RTNL 


ADJUST TC USCR 


FA49 


00 






375 


PLA 




STACK. SAVE 


■:,-;'. 


as 


H 




.<7o 


STA 


RTNH 


FTIJ ADR. 


FA4C 


A2 


ua 




377 


LDX 


iSUb' 






FA4E 


3D 


ic 


PB 


376 XQINIT LDA 


3NIT3L-1.X 


init ; 


FAil 


95 


;c 




379 


STA 


XQT.X 






FA53 


CA 






3B0 


DEX 








FAi4 


Du 


pa 




3ol 


3NE 


XQINIT 






FA 56 


Al 


1A 




332 


LDA 


(PCL.XJ 


USER OPCODE BYTE 


Fa 5a 


Fu 


42 




383 


3EC 


X3RK 


SPECIAL IF BREAK 


FA5A 


A4 


2F 




344 


LDY 


LENGTH 


LEK 


FROM DISASSEMBLY 


FA5C 




:.u 




3d5 


CMF 


IS20 






FA5E 


pa 






3bo 


3EC 


XJSR 


HANDLE JSR, RTS . JAr 


FAoJ 


c* 


BO 




3b/ 


CMP 


*S60 


J 


IF ( 1 . rt: speci 


FA62 


Fw 


i5 




380 


3 EC 


XRTS 






FAo4 


cs 


i 




3d 9 


CMP 


i54C 






FA 00 


FU 


5C 




j g _ 


3E0 


XJ.HP 






FA oo 


C9 


bC 




391 


CMP 


I56C 






FAoA 


Pu 






392 


SEC 


XJMPAT 






FAoC 


C9 


■i 






CMP 


IS4U 






FAoE 


pa 


5 S 




394 


3EC 


XfiTI 






FA70 


29 


LP 




395 


AND 


*S1F 






FA72 


49 


14 




390 


BOB 


• 514 






FA74 


C9 


04 




397 


CMP 


ISU4 


COPY USES INST TO XE 


FA 7 a 


Fii 


02 




39d 


3EQ 


.<Q2 


.. ITB TRAILING MOPS 


FA7ti 


31 


3A 




J»9 Xjl 


LDA 


(PCD, If 


CHANGE REL BRANCH 


FA7A 


99 


,C 


Ufl 


4 Uu XQ2 


STA 


XCTNZ.Y 


DISP TO 4 FOR 



e 



_^ 






5? 






160 



FA7D: 

FA7E: 

FAbU: 

FAbJ: 

PAdo: 

FAod: 

FAd9 

PAoA: 

FAoB 

PAdC 

FAOD; 

FA8P 

FA92; 

FA 9 J 

FA»o; 

FA9? 

FAW9: 

FA9A: 

FA9C: 

FA^F: 

PAA2: 

FAA5 

FAA6; 

FAA/. 

FAA»; 

FAAA: 

FAAC: 

FAAD: 

FAAF 

FAB1: 

FAB 4: 

FA36: 

FA07: 

FAB91 

FABA: 

PABD: 

FABC: 

FABF: 

FACu. 

FAC1: 

FAC2: 

FAC4 

FAC5; 

FACi 

PACB: 

FACs 

FACB: 

FACE; 

FACF: 

FAD1: 

FAD 3. 

FAC4l 

FAD 6; 

PAD7; 

FA DA 

FA DC : 

FADE; 

FAE2: 

FAE4: 

FAEfa 

FAE9: 

FAEC 

PABP: 

FAF1; 

FAF4 

FAF6: 

PAPS; 

PAPAi 

FAFC: 

FAPD: 

FAFE: 

FBOu: 



IU F6 

20 IP 

4C K 

d: 45 

m 

OA 

DA 

UA 

30 U3 

6C FE 

2d 

20 4C 

6d 

D3 3A 

60 

dS jB 

2a U2 

20 DA 

4C 5 

Id 

fed 

ri5 4d 

bd 

6~5 ^A 

68 

65 38 

A5 2F 

2U 56 

a4 33 

Id 

90 14 

Id 

20 54 
AA 
■•--. 
4B 

£A 
4B 

. 
IB 

.1 

■VA 

30 

ai 



ai 3a 



3A 

66 38 

d5 3A 

au P3 

M 2D 
4d 

A5 2C 
48 

20 qE 

A 9 4 5 

dS 40 
■ 

as 4] 

A2 PB 

A9 AO 

20 ED 

BD IE 

20 ED 

A* BD 

20 ED 

B5 4A 

20 DA 
EH 

30 EH 
00 
Id 

AO Ql 

Bl 3A 



401 

402 

FP 4ui 

uo 4L4 

4u5 
40b 
407 
40d 
4U9 
410 
411 
03 412 

FF 414 
415 
416 
417 

41(3 

Fd 419 

FA 42u 

FF 421 

422 

423 

424 

425 

426 

427 

42d 

429 

F7 430 

431 

432 

433 

434 

F9 435 

436 

437 

. | ■ 

440 
441 

(4a 

443 
444 

44b 
446 
447 

44* 

4Su 

451 

452 

45; 

FD 454 

455 

456 

457 

450 

459 

4 60 

PD 461 

PA 462 

PD 463 

464 

FD 465 

466 

FD 467 

4 03 

469 

4 ru 

4/1 
472 
473 



I BO 



33EAK 



XBKX 



PC INC 2 
PC INC 3 



XJ5R 



XJMP 
XJttPAT 



NEW PCL 



RSCDSP 
ft GPS PI 



R DS !- . 



DEY 

BPL 

JSH 

JMP 

STA 

PLA 

PHA 

ASL 

ASL 

AS£ 

BMI 

JMP 

PLP 

JSR 

PLA 

STA 

PLA 

STA 

JSR 

JSR 

JMP 

CLC 

PLA 

STA 

PLA 

STA 

PLA 

STA 

LDA 

JSR 

STX 

CLC 

3CC 

CLC 

JSR 

TAX 

TYA 

PHA 

: 

PHA 

LDY 

CLC 

LDA 

TAX 

DEY 

LDA 

STX 

STA 

acs 

LDA 
PHA 
LDA 
PHA 
JSR 
LDA 
STA 
LDA 
STA 
LPX 
LDA 
JSR 
LDA 
JSR 
LDA 
JSR 
LDA 
JSP 
INX 
BMI 

CLC 
LDV 
LDA 



xgi 

RESTORE 
XQTNI 
ACC 



ft 
A 
A 

BREAK 
( I ROLOC : 

SAV1 

PCL 

PCH 
INSDS1 
RGDSP1 
HON 



STATUS 

PCL 

PCH 

LENGTH 
?CAD J 3 
PCH 

NEW PCL 

FCALJ2 



15U2 
<PCL),Y 



(PCLI ,Y 

PCH 

PCL 

XJriP 

BTNH 

RTNL 

CRCUT 

SACC 
A3L 

iACC/256 

ajh 

ISPB 
■SAQ 

COUT 

RTBL-SFB.X 

COUT 

tSBD 

COUT 

ACC+5.X 

PRBYTE 

RDSP1 



JMP TO 3 RANCH 3A 

NeRANCH FROM XEQ. 

AL5TCRE USE* MEG CON 

XEC USER OP FKCM RAM 

(RETURN TO NBRANCIII 

••IRC HANDLER 



TEST FOR BREAK 

USER ROUTINE VECTOR IN RAM 

SAVE REG'S ON BREAK 
. . LUDINC PC 



PRINT USER PC. 

AND PEG'S 
GO TC MCN1TCR 

SIMULATE RTl BV EXPBCTISG 

CHEN RTS 

STS SIMULATION 

EXTRAC1 PC FflOH STACK 

AND UPDATE PC BY I [LEN-u) 



UPDATE PC BY LEW 



UPDATE PC AND PUSH 
DMTG STACK FOR 
JSR SIMULATE 



LOAD PC FOB _"> . 
(JMP) SIMULATE. 



DISPLAY USER REG 
CONTENTS WITH 
LABELS 



rsoi 

(PCLl.Y 



BRANCH TAKEN, 

ADD LEN*2 TO PC 



(•I 



FBu2: 


. 


■ 


474 




JSR 


Pi •>;..;, 




FBu;: 


n) JA 




475 




STA 


PCL 




FBu7: 


■ 




476 




tva 






■ 


- ■ 




4/ 1 




SEC 






PBUtf: 


■ 




4 7a 




3CS 


PC INC 2 




FBuQ: 


; ' 




■ 


NBRNCB 


JSR 


SAVE 


■ . 


:■■ ."■ ■ L : 


3d 




4oO 




SEC 




XEC UBEJ 


FBUF: 


bu ■}£ 




.', g . 




BCS 


PC INC 3 


30 UPDATE PC 


Fail: 






4-2 


... 


NOP 






PB12i 


EA 




463 




N h 




DUHMH PI LI 


FBI J: 


.. 


PI 


464 




IMP 


ZJBRNCH 


\REA 


FBln: 


4C FD 


FA 


43 5 




■IIP 


BRANCH 




■ 


1 




466 


HTBL 


DFB 






FB1A: 






4oi 




DFB 


SD6 




FB1B: 


-.' 




4 so 




DFB 


.- ■ 




FB1C; 


Do 




■ • 






5Do 






DJ 




■ 




DFB 


. 




FB1E: 


AD lu 


Cm 


I (J 


PREAD 




PTR1G 


?t CDLES 


. . . 










LDY 


- 


" 


. 


EA 




• 




HOP 




■ . 


FB24: 


EA 








NOP 






. 


BE d4 


C(J 


4*5 


PSEADi 


I. DA 


. 


VERY 


■ 


lJ j4 








■ 




- USJJC 


FB2A: 






4*7 




INY 






FE'3: 


OU Fo 








3NE 


PREAD 2 


ET AT 2 




o6 




199 




DEY 






FBIE; 






300 


. - 


RTS 








" ■ 




5l/l 


: N r [ 


. . ■ 


*5uO 


CLR S-. , 


. 


1 




5u2 




■ ■ 


. 


sop:.. 


F333: 


' . 


CJ 


■ 




LDA 


. .. ■ 




FB3fl: 


AD 54 




1 




LDA 


LGWSCB 


[NIT VII 


Fe3!J: 


AB 51 


CO 


505 


SETT XT 


LDA 


: ■. . 


FOR TEXT MODE 


FBJC: 


A* uu 




506 




LDA 


■ ■ 


. ; ll;. 


FBJt: 


Fv «B 








3EC 


.. 




FB4.U: 


ftL 5b 


Cu 


Sue 


SETGR 


LDA 


rXTCLR 


II 1 1 . . - : MODE 


■ 


AD 5 J 


C U 


50» 




LDA 


UIX5ET 


..:-- 4 line; ■-. 


FB4n: 


2u 36 


b - 


510 




JSR 


rLRTCP 


TEXT .WINDOW 


- 


■ - - 








LCA 






FI14d: 






512 


-. 


STA 


NNOTOP 


SET FOB 41 


FB4D: 


A9 uu 




513 




LCA 


1 


i , :n a-reg, 


FB4F: 


. 




514 




STA 


WNDLFT 


. :me 24 




Ay 28 




515 




LDA 


IS28 




FB53: 


z-j 21 




516 




STA 


•SSDWDTH 




FB55: 


A? Id 








L D S 


- 




FBIW: 


BS 23 




5U 




STA 


tfNDBTM 


VTAB TO Ri .. 


PB5*: 


Ay 17 








LDA 


*S17 




FB5B; 


oi> 25 




520 


TABV 


STA 


CV 


VTABS TO ROW IN A-REG 


FB5Q: 


; . . 


F C 






JMP 


VTAB 




FBuu: 


2o A 4 


PB 


- 


KULPM 


JSR 


MD1 


ABE VAL OF AC MIX 


FB63: 


At 10 




- 


MUX 


LCY 


*SlQ 


INDEX FOR 16 SITS 


FBb5: 


M 5U 






MUL2 


LDA 


ACL 


ACX • -v .<: - (TNI 


FB67; 


IA 




525 




LSR 


A 


SC , MS 




9U OC 








8CC 


l< U L 4 


■ CARRY, 


FB6A: 


lb 




527 




CLC 




SO PARTIAL PROD. 


FBoB: 


A 2 PE 




:-2o 




LDX 


ISPE 




FB6D: 


B5 54 




- 


tl L 


LDA 


II L-2.X 


ADD HI L. 


FBoF: 


75 56 




530 




ADC 


AUXL*2,X 


TO PARTIA.. 


FB71i 


*S 54 




531 




STA 


i *2,X 


(XTNDI . 


FBii: 


Eft 




532 




INX 






FD74: 


Dd f; 








HI 


• : . 




- 


■ . 




■ 1 


HUL4 


LLX 


IS03 




F3 7o; 


it 




535 


MUL5 


DFB 


»S76 




FB79: 


5Q 




536 




CFB 


»S50 




FB7A: 


A 




! . ■ 




CF.X 






FB7B: 


10 FB 




536 




BPL 


. 1 . 






38 




5 3'i 




DEY 






PB7E: 


CO E5 




: 




SNE 


MUL2 




FBHU: 


Ud 




1 ■ 




RTS 






FBUl: 


; 


rr 


542 


. . 1 ■ 


■ 


HOI 


ABS VAL -F AC, AUX. 




Au lu 




541 


d:v 


LEV 


• SIu 


■ FC?. 16 33 E 


: 


Ob So 




544 


DIV2 


ASL 


ACL 




FBOB: 


- 




54 5 




ROL 


ACH 




■ 


2o 52 




54o 




KOL 


■ ■ 


• :■■ . ■ ■ 



!'■: 



F3nC 


2o 


5 3 


547 




RCL 


XTNDIf 


TO AC. 


FBOE 


JO 




54c 




SEC 






cBaF 




5; 


54y 




LDA 


XTNDL 




. 


: ; . 


! ■ 


5 50 




SBC 


AC XL 


■■ .. . 




AA 




551 




TAX 






- 


*5 


53 


552 




LDA 


■ ■ ■ 




FD9D 


E5 


3 5 


. 




SBC 


AUXH 




fBl*U 


II 


Ja 


534 




BCC 


■ 




?a <jA 


II 


52 


55; 




STX 


XTNDL 




FB*C 


33 


. 


55o 






XTWBH 






Eb 


1U 


55? 




ISC 


ACL 




:3At- 


3Q 








3EY 






fliAl 


DlJ 


E 3 


559 




3NE 


■ 




F BA 3 


1U 








RTS 






FDA 4 


Au 


uU 


Sol 


MDl 


LEY 




A3S VAL jc ACi AUX 


FBA6 


- 


-l- 


562 




. 


• 


*ITh RESULT SIGN 


FBA6 


a; 


^■i 


56J 




LDX 


«AUXL 


IN LE3 DP 3ZGN< 


FBAA 


20 


\P pfl 


5o 4 




] 5 R 


MD2 




FBAD 


A 2 


50 


565 




LDX 


»ACL 




FBAF 


B; 


■j L 


566 


MD2 


LDA 


:.:..■ 


X spec :. -;--.- 


rBBl 


10 


30 


56 7 




BPL 


MDRTS 




FBBi 


la 




5bd 




SEC 






FB84 


Jo 




565 


MD3 


TYA 






FBB5 


F5 


Lii 


570 




SBC 


LOCU,X 


:0>!PL SPECIFIED REG 


PBB7 


93 


UU 


5U 




STA 


LOCQ.X 


IF NEG. 


FEB* 


96 




572 




TYA 






FBBA 


F5 




573 




SBC 


LOC1.X 




FBBC 


95 


01 


574 




STA 


LCC1.X 




FBBE 




:? 


575 




■ 


SIGN 




FBC 


60 




576 


MDRTS 


RTS 






FBC1 


■ -■ 




577 


dASCALC 


FHA 




CALC BASE \DB IN 3ASL, H 


FBC2 


IA 




578 




LSR 


A 


FOR GIVEN LINE NO. 


PBC3 


29 


U J 


579 




AND 


• 


0< -LINE NO.(*S17 


FBC5 


09 


h>4 


56u 




QRA 


#504 


ARG-UJOABCDE, GENEf . 


FBC7 


95 




5ol 




STA 


BASH 


3ASH-0U0' 


■ 


uu 




562 




PLA 




ASL 


FdCA 






5ul 




AND 


4S1B 


BASL-EABA . 


FBCC 




,, 2 


5d4 




acc 


BSCLC2 






o9 


?r 


5o5 




\DC 


*57F 




FBDu 


35 




5B6 


3SCLC2 


^TA 


. - 




FBD2 


OA 




5b; 




ASL 


A 




FBD^ 


J A 




5od 




ASL 


A 




F3D4 


d5 


: a 


50* 




■ 


BASL 




FBLb 


as 


IB 


590 






9ASL 




FECb 


DO 




591 




RTS 






FDD a 


. i 


a i 


592 


BELLI 


CMP 


■ 567 


BELL CHAR? (CNTRL-GI 


FBDB 


DO 


1 2 


• 




3NE 


BTS2B 


HO, RETURN 


t=ecD 


A 9 


40 


594 




LDA 


»S40 


DELAY .ul SE 


F90F 


20 


AM FC 


59 5 




JSR 


HA IT 




FBE2 


a a 


■lu 


J9G 




LDY 


pSCO 




: 


A9 


liC 


• 


BELL2 


LDA 


*50C 


1 iAKER AT 


FBE6 


20 


Ab FC 


59B 




JSR 


■ : ■ 


1 KH2 POB . : 


. 


\L 




599 




LDA 


SPItfl 




FBEC 


■ 




600 




DEY 






FBt'D 


Lu 


P5 


601 




IM 


BELL2 




F6EF 


ou 




■ • 


AT5 2B 


RTS 






FBFO 


A4 


- ■; 




STOACV 


LDY 


CH 


COBSEfl H EX :: Y-RBG 


FBF2 


*1 


2e 


j04 




. . ■ 


IBASL) ,Y 


STOP Ch,\\- 


FBP4 


L» 


-•i 


ou5 


ADVANCE 


INC 


CB 


INCREMEKT CURtEr. 9 


FBFti 


aS 


24 


bOD 




LDA 


CH 


.' 


FBFa 


C5 


21 


601 




CMP 


-■ 


3EYOND WINDOW h 1 


FBFA 


Bu 


OO 


■ 




3CS 


CR 


YES CR T' 


FBFC 


OU 




6u9 


RTdJ 


RTS 




NO, RETURN 


FBFC 


C* 


id 


olo 


viocur 


CMP 


JSAU 


■ ■ - 


FBFF 


B(J 


:. L 


611 




dCS 


SIOADV 


30, OUT PUT IT. 


FCul 


At) 




612 




r iv v 




INVERSE VIDEO? 


FC0 2 


10 


EC 


613 




BPL 


STCADV 


YES, UUTPL'T IT. 


FCu4 


' 


ID 


14 




M 


• 36D 


CR? 


■ 


Fo 


;\ 


615 




3EC 


CR 


YES. 


t 


C9 


jfl 


olb 




CMP 


BSoA 


LINE FEED? 


FCUA 


FO 


SA 


617 




3EQ 


LF 


IF SO, DO IT. 


FCuC 


Cfl 


a a 


616 




CHP 


»S38 


BACK iPACE? (CIITRL-H) 


PCdE 


Ou 


cs 


: • 




BNE 


BELLI 


NO, CHECK POB dELL. 



163 



FC10 


Co 


-■; 


62U 


35 


DEC 


CH 


DECfiEHENT CUfiSER H INDEX 




FC12 


10 


B8 


621 




a pl 


RT33 


IF POS, OK. £LSE -IOVE UP 






AS 


.: 


622 




LDA 


WNDWDTH 


SET CH TO WNDrtDTH-! 


— 


PC16 


o5 


..i 


d:j 




STA 


CH 






. 


: u 


24 


624 




DEC 


CB 


(RIGHTMOST SCREEN PCS) 




FClA 


AS 


,2 


62S 


DS 


LDA 


WNDTOP 


CURSEP V INDEX 


- 


FC!C 


C5 


.5 


dZd 




CMP 


CV 






FC1E 


EU 


JB 


d27 




BCS 


RTS4 


IF TOP LINE THEN RETURN 




FC2u 


Cb 


25 


62d 




DEC 


CV 


DECR CURSEP. V-INDEX 


- 


fc:j 


A5 


25 


629 


VTAB 


LDA 


CV 


GE1 CURSEP V-INDEX 


fc:4 


20 


C! 


FB 63u 


VTASZ 


J3S 


3ASCALC 


GENERATE BASE ADDR 




i :: 


6* 


-J 


oil 




ADC 


WNDLFT 


ADD rflNDOW LEFT INDEX 


_ 


FC2» 


B5 


2fl 


oJ2 




STA 


3ASL 


TO BASL 


" 


FC2B 


60 




633 


H7S4 


RTS 






FC2C 


49 


CU 


634 


ESC1 


ECR 


iSCU 


ESC? 




FC2E 


FU 


:^ 


63 5 




BEO 


HOKE 


IF SO, CO HGHE AND CLEAR 


h 


FCJU 


69 


PC 






ACC 


»5FD 


ESC-A OR 3 CHECK 




FC32 




CO 


637 




BCC 


ADVANCE 


A, ADVANCE 




FCJ4 


Fu 


DA 


633 




BEO 


BS 


B, BACKSPACE 


— 


FC^o 


69 


:Z. 


o39 




ADC 


*5FD 


ESC-C OR D CHECK 


U 


FC3d 


90 


K 


640 




acc 


LF 


C.DOWN 




FC3A 


Fu 


DE 


641 




BEQ 


UP 


D, GO UP 




FCiC 


09 


Ffl 


64 2 




ADC 


*SFD 


ESC-E OR P CHECK 


i 


FCjE 


yu 


5C 


643 




BCC 


CLRECL 


E, CLEAR TC EMC OF LINE 


*~ 


FC4u 


Dl 


E9 


o44 




BNE 


RTS 4 


NOT F, RETURN 






A4 


-■; 




CLREGP 


ldy 


CH 


CURSOR II TO Y EHDEX 


5 


rc« 


A3 


25 


d46 




LDA 


:v 


CURSOR V TO A-REC: 


FC4t> 


40 






CLEOP1 


PHA 




SAVE CURRENT Lllit - 




FC47 


20 


24 


FC 646 




JSR 


VTAB3 


CALC BASE ADDRESS 




FC4A 


2o 


ye 


FC 649 




JSP 


CLEOL2 


CLEAR TO EOlri SET : I 


u 


PC4C 


Ay 


00 


65y 




LDY 


rsoa 


CLEAR ?ROM M INDEX-U FOR PEST 




FC4F 


bD 




bil 




P LA 




INCREMENT CURRE:.*! LINE 




FC5u 


o9 


J.! 


bS2 




ADC 


»50U 


(CARRY IS SET) 


i 


PCS 2 


C5 


■ 


6SJ 




CMP 


WNDBTM 


PO aOTTCH OF .VINDOh? 


■ 


9u 


Fl 


034 




BCC 


CLEOP1 


. KEEP CLEAI . 




FC56 


BU 


: * 


OSS 




BCS 


VTAB 


YES, TAB TO CURf 




FC5d 


Ai 


22 


060 


HOME 


LDA 


WNDTOP 


I«IT :^;^- 


■ 




si3 


- 3 


657 




: ■ 


CV 


: H-IHDICES 






Au 


.L 


t>53 




LDY 


ISDO 






PCiE 


o4 




059 




STY 


CB 


THEN CLEAR TO 'JNC Of 


■ 


FCou 


FO 


E4 


Qbu 




3EC 


CLEuPI 






FCb2 


A9 


■J.J 


66] 


CR 


LDA 


*S00 


CURSOR TC LEFT OF INDEX 




FC64 


o5 


:■; 


662 




STA 


.:h 


(RE-I K"UJ 


i 


FCoo 


Ed 


25 




LF 


INC 


CV 


INCH CURSOR VlOCWN 1 LINE! 


FCoa 


AS 


-: 


ii 1 




LDA 


CV 






FC6A 


C5 


2 i 


665 




11 


WNDBTM 


E ZrtiEN? 


_ 


FCbC 


yy 


Zr. 


66b 




BCC 


VTAEZ 


NO, SET BASE ADDR 


•> 


FC6E 


Cb 


:i 


o67 




. 


CV 


DECR CUSS: 30TTOM) 




FC70 






06a 


SCROLL 




WNDTOP 


!Rt WNDW 




FC7 2 


413 




669 




PHA 






i 


PC V 3 


. 




FC o?.l 




JSR 


VTABZ 


GENERATE 3ASE ADDRESS 


FC 7 6 


AS 


20 


671 


SCRLl 


LIM 


3ASL 


COPY 3ASL.K 




FC7d 


as 


2A 


672 




STA 


3AS2L 


TO BAS2L.H 


- 


FC7A 


A5 


29 






LDA 


BASH 




V 


FC7C 


»5 


;^ 


674 




STA 


3AS2H 








• 


21 


0.1 




LDY 


WNDWDTH 


•: TC RIGHTMCS: 




FCoO 


a8 




676 




DEY 




OF SCROLLING WINDOW 


i 


Fcai 


DO 




d77 




PLA 








PC82 


0* 


01 


670 




ADC 


iSOl 


INCR LINE NUMBER 




PCd4 


cs 


2i 


679 




CMP 


WNDBTM 


DONE? 


■ 


PCdb 


au 


OQ 


660 




3CS 


SCRL3 


YES, 


FCod 


46 








PHA 








rC'69 


.0 


- ■, 


PC 682 




JSR 


VTABfl 


FORM 3ASL.il iBASE ADOR) 


_ 


FCdC 


Bl 


Z8 


6&3 


SCRL2 


LDA 


(BASLl.Y 


MOVE A CRR UP ON LINE 


E 


FCut 


91 


-■ 






STA 


(BAS2LI , Y 




■ 


FC9U 


no 




. 




DEY 




NEXT CHAR OP L 




FC91 


u 


F9 


■jOo 




SPL 


3CRL2 




i 


FC93 


30 


El 


bfl7 




3M1 


SCRL1 


NEXT LINE 


■ 


AU 


u_ 


O e,o 


SCRL3 


LDY 


»SUO 


CLEAR BOTTOM LINE 




FC97 


- 


r j£ 


FC ody 




JSh 


CLECLZ 


GET 3A5E ADOR FOR 3CTTOM LIKE 


- 


FC9A 


BU 


-D 


o9d 




BCS 


VTAB 


CAWU [S SET 


i 


FC9C 


A4 


. - 


o9i 


CLREOL 


LDY 


CH 


CURSOR II INDEX 




PC^E 


Ay 


,\<J 


692 


CLBOLI 


LDA 


ISAO 




6 



164 



FCAu 


91 


-- 


a9J 


CLEGL2 


STA 


(BASH , Y 


-■ :as 


Co 




'j 'J 4 




INV 




PCA3 


C4 


21 


• 




CPY 


WNDWDTH 


FCA5 


y u 


F9 


3^0 




BCC 


CLEQL2 


FCAJ 


bu 




o*7 




RTS 




FCAo 


-d 




Mid 


rfAIT 


SEC 




FCA9 


40 




6*9 


KAIT2 


PHA 




FCAA 


E9 


Ul 


700 


■ 


SBC 


*50I 


FCAC 


Du 


FC 


701 




8NE 


.. h i t 3 


FCAE 


oa 




702 




PLA 




FCAP 


E9 


n 


7ui 




SBC 


ISO] 


Fcei 


CO 


F6 


7J4 




9NE 


*AIT2 


Fcai 


DO 




7*5 




RTS 




FC34 


Ed 


12 


706 


NXTA4 


ISC 


A4L 


FCBb 


DO 


02 


707 




BNE 




FC03 


Ed 


4, 


. 




INC 


A 4 It 


PC8A 


Ab 


3C 


7bJ 


fJXTAl 


LDA 


AIL 


FCBC 




jt 






CMF 


A2L 


FCBB 


A3 


3D 


711 




LDA 


A IB 


PCCv 


E5 


3F 


712 




SBC 


A2H 


FCC 2 


Eo 


1C 


713 




::;■: 


A!L 


FCC 4 


Du 


u2 


714 




3NE 


RTS4B 


FCC 6 


E6 


JD 


715 




■ 


Alii 


FCCo 


6u 




7lb 


RTS 48 






FCCsi Au 


4B 




dEAOfl 


LDY 


S54B 


FCCS 


- 


S3 PC 


;:u 




J5R 


ZERDLY 


PCCE 


DU 


Si 


(19 




BNE 


. ,. , 


FCDO 


** 


n 


720 




ADC 


55FE 


FCD2 


SO 


P5 


723 




9CS 


■ 


FC04 


Au 




722 




LDY 


S52J 


FCObl 20 


DB FC 


!23 


..*= : : 


J5R 


ZEBDLY 


FCD9 


Za 




724 




;:iy 




FCDA 


Co 




725 




I N i 




FCCD 


B8 




)2b 


ZERDLY 


DEY 




FCDC 


Ou 


FD 


72? 




3NE 


ZERDLY 


FCDE 


yu 


OS 


72b 




3CC 


rffTAPE 


FCEu 


AU 


32 


<2* 




LDY 


«5j2 


FCE2 


rib 




730 


CNEDLY 


DEY 




FCE3 


DU 


FD 


731 




BNE 


CSEDLY 


PCE5 


AC 


20 Cu 


732 


WRTAPE 


LDY 


PAPBOW 


FCEo 


Au 


2C 


7jj 




LDY 


1S2C 


PCEA 


CA 




734 




OEX 




FCE3 


fill 




735 




:■ i ;. 




PCEC 


a; 


Jfl 


'36 


RDBYTE 


LDX 


.SOS 


PCEE 


4b 




737 


SDBYT2 


PHA 




FCEF 


20 


FA FC 


738 




JSR 


R C 2B I 7 


FCF2 


bd 




739 




PLA 




FCFi 


2A 




740 




SQL 


A 


FCF4 


Au 


jA 


741 




LDY 


»S3A 


FCF6 


CA 




742 




DEX 




FCFJ 


DO 


?3 


/43 




BNE 


RDBYT2 


FCF9 


bi 




M4 




RTS 




FCFA 


... 


PD FC 


»45 


RD2BIT 


JSR 


BDBIT 


FCFD 


afl 




74b 


BDBIT 


DEY 




FCFE 


AC 


50 CI 


747 




LDA 


TAPEIN 


FDUl 


4$ 


:? 


74b 




EOR 


LASTIN 


FCUi 


LU 


PB 


749 




3PL 


RDBIT 


FDU5 


45 


:.- 


750 




■ 


LASTIN 


FDO) 


us 


2p 


751 




STA 


LASTIN 


FDO* 




du 


752 




:i-y 


iSBu 


FDOfl 


uu 








RTS 




FDOC 


A4 


24 


7 54 


RDKF.Y 


LDY 


CH 


FD06 


Bl 


2d 






LDA 


(BASLl ,Y 


FD10 


4H 




756 




PHA 




PD11 


29 


JF 


757 




AND 


?SJF 


FDli 


u9 


lu 


7 3d 




.-.■• 


fS40 


FD15 


yi 


2a 


759 




STA 


(BASLl . Y 


PDl i 


t>6 




76U 




PLA 




Ftlo 


oC 


Ja Jo 


751 




J^F 


IKSWLI 


FOIB 


to 


4C 


,\>2 


KB KM 


INC 


R:.DL 


FLlD 


cu 


02 


7b J 




BNE 


KEYIS2 


FD1F 


E« 


4P 


•'64 




INC 


RHDH 


■ • 


2C 


uo Cu 


765 


KEYIN2 


BIT 


KBD 



RE BLANKS FF.CH 'HERE* 

TO END OF LI. - I JOTH1 



1.0204 L'SEC 
<13+2712*a. 512< - 



2-DYTE A4 
AND Al 

I NCR 2-BVTE M. 

AND COHPAB 

(CARRY SET IF ,' = i 



^RITE A- 2 5d 'LCMG 1 ' 
HALF CYCLES 

JSBC EACH > 

THEN A 'SHORT U' 
(40U 'JS EC) 

WRITE :■■■ CYCLES 

3F 250 USEC ('O'l 

OR 500 USEC COM 



Y IS COUNT FOR 
TIMING LOOP 



B BITS TO READ 
READ TWO TRANSITIONS 
(FIND EDGE I 

NEXT 9 IT 

COUNT FOR SAMPLES 



CECB Y UNTIL 

TAPE TPASSITICN 



SET CARRY ON Y-*EG. 
CREEN TO : 



GG TO USER KEY-IN 
INCR RND NUMBER 
KEY DOWN? 



165 







■ 




1d6 




1 


SI : . . ■ 


LCCP 


FC2t> 


91 


.... 




'61 




oTA 


(SASL] , Y 


REPLACE FI I CREEN 


. 




. 


cu 






■ ■ 


Kac 


CE3 KEYCCDE 


F028 


i 


1 (J 




To? 




3IT 


K9D3TR3 


CLR K£3 




t OL 










3TS 






fd;f 


- 


UC 


l-U 


771 


ESC 


■ 


KDKEY 


IfCODE 


PC 32 


It 


- 


PC 


. v: 




■ 


E3C1 


'■■. i : :. . 


FCJ5 




JC 


FE 


773 


RECtJAR 




RJ3KEY 


. L KEY 


FLJjj 




*B 




774 






•SSB 


esc: 


FC3A 


F. 


r: 




m 




BEC 


ESC 


YES, CON' 


F03C 


DU 






■ 




8TS 








A3 


)2 




777 


■ 


LCA 


■ 




PD3P 


4j 






7io 




PUA 






FD4U 


AM 


FF 




7 7 'J 




LDA 


*SFF 




!■■:..;. 


oh 


. 




7 flu 




5TA 


INVF LG 


ECHO USEfc LINI 


FG44 


ac 


JO 


i. 


■il 




LDA 


I :j , :■; 


. INVERSE 


fC47 


2U 


so 


■ i 


7o2 




J5R 


. . . 




FC4A 


6a 






■ 




PLA 






FD43 


d5 


12 




7d4 




ST A 


INVPIG 




FC40 


BD 


oO 


- 


7bi 




LDA 


LN.X 




FD J 


cs 


3,-; 








Ml 


BSAd 


CHECK FOR EDIT KEYS 


FCS2 


Fu 


.- 




>*") 




BEC 


BCKSPC 


35. CTRL-X. 


FD54 


ca 


* : 




7Ba 




: i 


*S96 




I . . 


FO 


IA 




7d9 




3EC 


CANCEL 






Eu 






?mu 




: ; x 


I 


MARGINS 


F L j ft 


■ 


j 3 




741 




BCC 


■ .... 




1 - 


■ 


A 


Ff 






JSR 


BELL 


¥ES, ■ -tLL 


FL5F 


La 






/9J 


NQTCR1 


: -i x 




\nv\:; :i. IHPDT I EDI :: 


KB 60 


Bu 


13 




794 




3NE 


KXTCUAR 




FC62 


A9 


X 




795 


■ ■ . 


LCA 


B5DC 


backslash vi ran - "jcell 


FD64 


20 


ED 


PC 


796 




JSE 


. 




:■ • 


20 


B6 


I- L 


■ 


GETLNJ 


JSP 


■ 


. i ■ . ::■ 


FDoA 


AS 


. 




)9fl 


GETLN 


LCA 


PROMPT 






^0 


BS 


PO 


■ 




JSR 


COLT 


. . ;■..■:. 


FCoF 


a: 


Ul 








LDX 


P501 


[Nil EHPUT tMCEX 


: . . 


a A 






Eul 


■ 1 






. : ! L BACKSPACE 


Fti2 


E 


i 




- 




BEC 


GETLNZ 




FD}4 


CA 






6uJ 




. .: X 






FC75 


2u 


■ 


PC 


iu4 


■ : 


JSR 


RCCHAR 




FD/d 


. - 










Ml 


*PICK 


^SE SCREEN :HAII 


PI . '■ 


L0 


03 




■ 




1NE 


■ | : . ■ . 


FOR CTRL-0 


FC7C 


Bl 


i i 




U.,7 




LDA 


IUASL) . Y 




FD7E 


C9 


Eu 




d U B 




CHF 


iiEc 




. 


9(1 


.: 




309 




3CC 


ADDU.P 


CONVERT T Al 


PEB3 


29 


CE 




Bill 




ASD 


BiDP 




PD«4 


SO 


Utl 


U2 


ail 


add: mf 


STA 


• ' 


ADD TC I NFL I BDE 




CM 


:.D 




. 




CMP 


•:3d0 




. ■ ■ 


Cu 


32 




dl3 




3NE 


■ 




FCo3 


20 


9C 


B : 


■ 






I : . 


;.i- PO EOL n 


FC6E 


• 


. 




. 


CROUT 




tsaa 








iu 




olo 




1 


COLT 




:■ 12 


A4 


JO 




ol7 


■ 


LDY 


A1H 


■ ■ . ' . ■. 


F Z<H 


Ad 


K 




old 




LDX 


.ML 




FC9oi ZA 


BE 


F D 


: l 




JSR 


CKCLT 




FC** 


2J 


!'■ 


F ■ 






JSR 


| :..-.,. 




1 




JU 




52 1 




LDY 


4iOG 




FLSE 


AM 


AC 








LDA 


BSAL 


. . ' - ' 


FDAU 


4C 


EB 


PC 


323 




JMF 


COUT 




PDA3 


A5 


. 




i; i 


xAsa 


LDA 


ML 




FDA 5 


u; 


01 




i; 






- 


£ET 10 r I:. : 




a- 


^£ 




2i 




■ 


A2L 


3 »7 




A3 


10 








LDA 


A1U 




FDAB 


as 


Ji 




13 




JTA 


-■ 




■ ■ 


■ 


-.: 




029 


.•lOBdCHK 


■ ■ 


AIL 




FCAF 


29 


j 1 




SJ J 




\ND 


;5J7 




.- . . . 


DO 


33 




631 




BNE 


' 




FD3J 


^u 


)2 


FC 


oil 


XAH 


jsa 


PHA1 




FDE6 


A 9 






d33 


3 ATA CUT 


LCA 


SSAU 




FOBS 


20 


£L 


FD 


d34 




JSR 


COOT 


OUTPUT BLANK 


FCBB 


Bl 


-■: 




Ui 




LDA 


(AIL).Y 




FDBB 


20 


CA 


ri: 






JSR 


PRBYTE 


ODTP17I CN HEX 


FDCO 


2d 


3 A 


f: 


611 




JSR 


NXTA1 








1.6 



te 



FLCJ 


9u 


Mil 


dJu 




BCC 


M008CHK 


FDC5 


60 




939 


STS4C 


RTS 




FLCo 


4A 




34U 


XAHPM 


LSR 


A 


FDC7 


9u 


EA 


641 




BCC 


XAM 


FDC9 


4 A 




642 




LSR 


A 


fCCA 


4A 




64i 




LSR 


A 


FDCB 


A5 


JL' 


t)44 




LDA 


A2L 


FDCD 


?u 


12 


n4 5 




3CC 


ADD 


FDCF 


4V 


FF 


o4o 




BOB 


ftiFF 


FUD1: 65 


)C 


647 


ADD 


ADC 


AIL 


FDD 3 


4d 




J4B 




PHA 




FDD4 


A» 


BD 


64 9 




LDA 


• 5BD 


FCDb 


20 


ED FD 65U 




J5R 


COLT 


FDD9 


od 




651 




PLA 




FDCA 


4a 




652 


PRBYTE 


PHA 




FCDB 


4A 




653 




LSR 


A 


FDUC 


4A 




654 




LSR 


\ 


FDDD 


i a 




D55 




LSR 


A 


FDDE 


4A 




65o 




Lsa 


A 


FGDr 


2U 


E5 FD 




JSR 


PRHEXZ 


FDE2 


6- 




d5a 




PLA 




FDEJ 




uF 


dS9 


PKHEX 


AND 


iSJF 


PDE5 


09 


31 


a 6.' 


PRHEXZ 


CRA 


KSQu 


fce; 


^* 


9 A 


d6l 




CMS 


t53A 


i-n. - 


yu 


02 


662 




BCC 


COLT 


FCEB 


oy 


UB 


663 




ACC 


«S06 


FDED 


bC 


-j ju no4 


CCOT 


JMP 


(CSWL) 


FDFO 


---• 


Al 


S6S 


COOT] 


CMP 


1 5 « u 


: : . 


■Jj 


02 


duo 




DCC 


■ 


PDF4 


25 


32 


■ 




AND 


IHVFLG 


PI3P6 


64 


i5 


H6S 




STY 


id AVI 


FCFa 


4b 




*09 




PHA 




. ■ 


2d 


FD FB 




JSR 


VIDOUT 


PDFC 


OS 




o71 




PLA 




FCFU 


14 


- 5 


072 




LDY 


YSAlp I 


FDFF 


t>0 




673 




RTS 






Co 


34 


674 


an 


DEC 


YSAV 


PEu2 


FU 


*f 


d75 




3E0 


■./.::- 


FEo4 


CA 




676 


BLANK 


3EX 




FE.,5 


DU 


Lfi 


977 




BKE 


1 . ■■ . 


FEu/ 


C9 


.A 


678 




CMP 


|S3A 


FE03 


D'J 


IB 


679 




BNE 


KAMI M 


FE13 


d5 


:I 


111 


. - 


STA 


MODE 


FEOD 


A3 


3E 


■ 1 | 




LDA 


A2L 


FBOf 


91 


4D 


:. 




iTA 


(A3L).Y 


FE11 


E6 


:-■ 


ao 1 




INC 


A3L 


FEI3 


Lu 


Q2 


oa4 




BNE 


RTS 5 


FEIj 


Ed 


11 


605 






AJ.4 


FEU 


60 




300 




RTS 




F£lH 


A 4 


j-i 


6o ) 


SETMODE 


LLY 


YSAV 


FEIA 


By 


r'F u 


1 30- 




LDA 


IN-l.Y 


FEIO 


BS 


31 


609 


SETMDZ 


: 


MODE 


FE1F 


00 




o9u 




RTS 




F£2o 


A2 


1 


tul 


LT 


LDX 


■5wl 


FE22 


85 


IE 


o92 


LT2 


LDA 


A2L.X 


FE24 


95 


42 


o*J 




STA 


A4L.X 


FEZo 


95 


44 


694 




ST A 


ASL,X 


FE20 


CA 




695 




DEX 




PE29 


Hi 


-'"■ 


690 




3PL 


LT2 


FE2B 


uu 








RTS 




FE2C 


ei 


1C 


898 


MOVE 


LDA 


(A1L),Y 


FE2E 


91 


42 


syy 




STA 


(A4D.Y 


FE30 


20 


. ■ 




JSR 


NXTA4 


FE3 3 


9U 


F7 


- 




BCC 


HOVE 


FE35 


60 




1\,Z 




RTS 




FE3o 


Bl 


3C 


9U3 


VFY 


LDA 


(AIL) ,Y 


FE'6 


Dl 


■-: 


au4 




CMP 


(A4LI.Y 


PB3A 


Fu 


1C 


905 




BEC 


VFYOK 


rEj; 


- 


92 PD b>0o 




JSR 


Cl-Al 


FE3F 


Bl 


3C 


90/ 




LDA 


(AIL).Y 


FE41 


2U 


□A FD >«a 




JSR 


PRBYTE 


B44 


A9 


AC 


»U9 




LDA 


*SAo 


FE46 


20 


ED FD 91u 




JSR 





CHECK IF riMl - 
PRINT ADDR 

DETERMINE IF HON 
MODE IS XAM 
ADD, OR SUB 



SUBi FORM 2'^ COMPLEMENT 



PR [NT 



THEN RESULT 



PRINT BYTE \S i HtX 

DIGITS, DESTKCYS A-SEG 



PRINT SEX DIG IN A-HEG 
LSB'S 



VECTC3 TC USLP OUTPUT 3CUTINF 

INVERSE 

MASK . :::■ inverse flag 

JAV Y-REG 
SAV A-HEG 
DTPD"] A-HEG AS *SCU 
: i'E A-P.EG 
AND Y-PEG 
THEN RETl 



s la nx ro 

AFTER BLANK 
DATA STORE MODE? 

v. . XAHi ADD ZR SUB 
KEEP IN STCRE MCCE 

5TCRE AS LOW BYTE AS [Aj 

incf a:, betubn 



SAVE CONVERTED ' i ' , ' • ' , 
'-•, '.' AS MODE. 



:OPY A2 (2 BYTES) TO 
A4 AND A5 



;:CVE (Al TO A2) TO 

iA4l 



VERIFY (Al TO A2) KITH 
<A4> 



167 



FE49 


A 9 


Ad 




MJ 




LOA 


|SAd 


PE4B 


2u 


ED 


FE 


91 2 






' 


FE4E 


31 


- 




Jl J 




LDA 


- ■ . '. 


FE50 


20 


UA 


pj: 


914 




JSK 


PHBYTE 




A9 


A- 




915 




LOA 


>SA9 


FLt>3 


20 


ED 


FL 


916 




JSP 


:: UT 


FE.50 


. 


•; 


FC 


1] 


VFVGK 


JSR 


NXTA4 




90 


D9 




9i8 




8CC 


VFV 


FE5D 


DU 






91 9 




RTS 




fese 


.'.. 


)a 


FB 


)2Q 


■ ■ 


JSfl 


A1PC 


FEol 


A 9 


14 




921 




LDA 


1S14 


FBt)3 


4n 








- 


PHA 




FCci 


2u 


U 


Ffl 


»2j 




JSR 


nisrosp 


FEo< 


20 


53 


F3 


924 




JSP 


PCAOJ 


FE6A 


o3 


'■ 




925 






FCL 


PE6C 


b4 


ia 




926 




STY 


1 'r 


FEbi 


no 






13 




PLA 




FEUF 


J; 






92 6 




SEC 




P/E <« 


E9 


Ul 








S3C 


isu: 


FE72 


Du 


E£ 




•- 




3.SE 


. . : 


FE7 4 


BU 






931 




*ts 




PE75 


BA 






932 


A IPC 


TXA 




FE76 


Fo 


o", 








BEG 


A 1 PCRTS 


FE73 


65 


iC 




£34 


AlPCLP 


L E ". 


AlL,X 


PE7A 


95 


1A 




J35 






PCL.X 


FE7C 


CA 






,36 




C£X 




FB70 




■ g 




937 




di-L 


AlPCLP 




DO 






,JB 


A1FCH1J 


. 




PEHO 


ha 


if 




• 1 


SE1 INV 


LDY 


tSiF 


PEB2 




J 3 




94u 






SETIFLG 


FEb4 


Ml 


PF 




941 


SETNORM 


LDY 


*SFF 


PEdo 


54 


i a 




942 


SETIPLG 


S7V 


[NVFtB 


F£d6 


oO 






*4 j 




RTS 




FEd9 


A9 


OQ 




944 


SETKBD 


LOA 


- 


FEiiB 


35 


3G 




J45 


[HI DM 


STA 


A2L 


PSoD 


A 2 


ia 




94b 


INPHT 


LCX 


iKSWL 


FEaF 


A0 


LB 




947 




LDY 


tKEYIN 


PB»1 


DO 


■■in 




946 




ONE 


IOPRT 


FE9J 


A9 


ot 




949 


SETV1D 


LOA 


■sua 


p e .- j 


65 


j^ 




950 


0UTP0H1 


STA 


A2L 


FB97 


A2 


JO 




951 


OUTPUT 


LCX 


?C5WL 


FE99 


AU 


PC 




952 




LDV 


iCOUTl 


FE9B 


A5 


JE 




953 


IOPRT 


LOA 


A2L 


FE9D 


29 


JF 




9 54 




AND 


iSOF 


PB9P 


FU 


Uu 








BEC 


1C1PHT1 


FEA1 


U9 


:>j 




s5u 




OftA 


fiIGADfl/256 


FEA3 


AU 


Du 




957 




LDY 


I5UU 


FEA5 


Fu 


u2 




958 




BEC 


IOPRT 2 


FEA7 


A9 


PC 




959 


I0PRT1 


L D A 


■COUT1/256 


PEA 9 


94 


uo 




Sou 


I0PHT2 


STY 


LCC U , X 


PEAB 


»5 


ul 




9ol 




STA 


L0C1,X 


PEAD 


ou 






9o2 




RTS 




FEAE 


EA 






9o3 




NOP 




FEAF 


EA 






964 




:)0P 




FEao 


■ 


Ofl 


so 


965 


XBAS1C 


JMF 


BASIC 


PEQj 


4C 


u3 


LI, 


9o6 


BASH 


JMf 


BASIC2 


FE36 


20 


75 


PE 


967 


GO 


JSR 


A IPC 


F£39 


20 


3F 


FF 


'iuS 




JSR 


RESTORE 


FESC 


oC 


J A 


00 


969 




JMP 


(PCD 


FESF 


4C 


D7 


FA 


970 


HECZ 


JMP 


REGDSP 


FEC2 


Co 


34 




971 


TRACE 


DEC 


YSAV 


FEC4 


2U 


^ 


PE 


972 


oTEPr. 


JSR 


A IPC 


FEC7 


4C 


43 


I A 


973 




JMP 


STEP 


FECA 


4C 


F E 


OJ 


974 


U5R 


MP 


USRADfl 


FECC 


A* 


til 




■ 


WRITE 


LOA 


■ 540 


FECF 


20 


c< 


■ 


■ 




JSR 


UEADR 


FED2 


AU 


21 




977 




LDY 


;52- 


FED4 




ou 




970 




LDX 


uuu 


FEC6 


41 


iC 




979 




EOR 


(A1L,X) 


FED* 


4a 






lou 




PHA 




FED9 


Al 






9ol 




LOA 


(A1L.X) 



ft 



MOVE -M (2 3V"t. 
PC IP SPEC '0 \KC 
EHBLE 2u I 

ADJUST PC EACH 



I.EXT CF 2*. IhSTRi 



:f lsf. ads 

. - ■ ... . . 



se1 fcr inverse vid 

:outI 
3et fcr normal vid 



SIMULATE PORT *0 INPtT 

SPECIFIED (KEYIN ROUTINEI 



SIMULATE POAT lO OU'I PUT 
SFECIFIEC (COUTl ROUTINE! 



SET RAM IN/OUT VEC 



TO 3A5: : ICHAlCK 

CONTINUE BASIC 

rc ?C IF SPEC'D 
RESTORE META REGS 
GO TO USER SUBR 
TO REG DISPLAY 

ADR TO PC IF SPEC'D 

TAKE ONE STB1 

TO L'SR SUBR Al USRADR 

JRITE 10-SEC HEADER 



hS 



m 



(SDB 


-a 


EC 


FE 


J02 




JSfl 


.. . : . 


FEDE 


2u 


,.s 


PC 


sas 




JSR 


■ 


FEE1 


\u 


LO 








LDY 


. 


PEE 3 


00 






jo: 




PLA 




FEE4 


J J 


EC 




48ii 




3CC 


WR1 


FEEo 


A (J 


2: 








LDV 


..... 


FEGO 


^ 


ED 


FE 


000 




JSP 


tf KBYTE 


FEEB 


Fli 


:. 




• ■ 




BEO 


DELL 


FEED 


A 2 


-j 




•>1<J 


n'RBYTE 


LDX 




PEEP 


UA 






-.-. 


WRBYT2 


A;L 


A 


FEPO 


20 


D6 


PC 






JSR 


,. . . . 


■ - 


OU 


FA 




*93 




DUE 




FEF5 


6U 






14 




RTS 




FEF6 


. ■ 


0(1 


PE 


• ': 


CRMGN 


JSR 


■ 


■ 


6tJ 






19b 




PL A 




FEFA 


or. 






9»7 




PL A 




FEFQ 


DO 


6C 




39S 




3NE 


HONZ 


FEFD 


2U 


•■i 


PC 




PEAD 


JSR 


RD28IT 


FFuu 


A* 


LB 




luOo 




LOA 


«S16 


FF02 


20 




PC 


- 




JSP 


HEADR 


pros 


65 


2E 




. .. 




STA 


ctutsun 


r"P u T 


20 


PA 


PC 


lOUj 




JSP. 


RD2BIT 


PFOA 


AU 


. ■! 




I0v4 


RD2 


LDY 


.524 


PFuC 


20 


PD 


f:; 


- - 




. 


RDBIT 


FFOF 


Bu 






Kt.6 




acs 


RD2 


FF11 


211 


PO 


FC 


. .. 




JSR 


RD3IT 


FF14 


Au 


33 




Uuj 




LDY 


«SJB 




20 


EC 


PC 


1U09 


RDj 


JSR 


RCBYTE 


FPli* 


bl 


JC 




lull) 




STA 


(AlL.X) 


FFlB 


- 


2E 








EOF. 


CHKSUH 




65 


2E 




LU12 




STA 


CHKSUM 


FF1F 


211 


a a 


FC 


Iul3 




JSR 


NXTAl 


FF22 


Ay 


35 




lul4 




LDY 


1535 


PF24 


»U 


F, 




1015 




BCC 


RDJ 


PP26 


20 


EC 


FC 


lulo 




' ■ 


RDOYTE 




C5 


2E 




lUlV 




:mp 


CHKSUM 


FF20 


FU 


uC 




10io 




9EC 


QELL 


FF2D 


Ay 


C5 




1 


PrtERR 


LDA 


' 




20 


5D 


PD 


102o 




JSR 


CCUT 


FF 3 a 


A* 


:■- 




I 031 




LDA 


i5D: 


- 


20 


ED 


FC 


1022 




JSR 


. . , 


FFJ7 


20 


ED 


PI 


lu2J 




JSR 


COUT 


-- 1 


A 4 


.i ; 




lu24 


3ELL 


LDA 


*Sd7 




•ic 


ED 


FD 


Ij25 




J HP 


COLT 


PFJF 


AS 


16 




1 J26 


RES3 3RE 


LDA 


: ; -< .u. 




40 










PHA 




FF42 


AS 


1: 




1o2o 




LDA 


ACC 


:" F •; ■, 


A6 


16 




. . 1 


RESTRl 


LDX 


XREG 


FP4« 


A4 


- 




lOJu 




LDY 


YREG 


FF-iO 


20 






. 




PLP 




c?Al 


6u 






Iuj2 




" 




PP4A 


C3 


45 




:■!! 


SAVE 


■ 


• 


FF4C 


JU 


4t, 




1U34 


SAVl 


SIX 


XREG 


■■ - : 


o4 


47 




- 




STY 


YREG 


PP5u 


■13 






1036 




PHI 




FF51 


03 






..... 




PLA 




PF52 


fc5 


4f 




. ij 




STA 


STATUS 


PP54 


BA 






- 




rsx 




FFa5 


do 


■i .- 




ll/40 




STX 


3PNT 




Del 






- ■ - 




. 




FF5d 


&u 






. -. 




PT5 




i . ■ 


2C 


»4 


PE 


- 


PE5ET 


. 


SETNOW 


Fl 


JO 


2F 


,-,-. 


1U44 




■ 


EK IT 


PF5P 


2u 


9 J 


FE 


1045 




JSfl 


SETV1C 


FF D 2 


. 


*9 


PE 


lu4fi 




1 J R 


3ETKBD 


FFb5 


Ds 






.,.. 


MON 


CLD 




FFoo 


..j 


jA 


FF 


1U4d 




JSP 


BELL 


FF65 


A 9 


\A 




104* 




LDA 


fSAA 


FPnB 


05 


13 




lU 3d 




STA 


PROMPT 


FF6D 


20 


3 ; 




lU3l 




JSR 


GETLN2 


FF7j 


2u 


c: 


PI 


10 S3 




J£R 


2M0DE 


PF73 


2>i 


\i 


FF 


1053 


NXTITM 


JSR 


GETMUH 


FF ,6 


d4 


34 




1054 




STY 


YSAV 



■ .. le :b \l 
then pop stack 

AMD RTN : 

:m edge 

delay 3.5 seconds 
iijit chksuh" 
find tapein edge 
look por sync 517 

I SHORT ui 

LOOP '■ UHC 

SECOND 'SYNC il-CYCLE 
INDEX FOR J/1 TEST 
READ A BYTE 
STORE AT (Al j 

UPDATE RQNNING CHKZITA 
1HCH Al, COMPARE TC A2 

I INDEX 
LOOP UNTIL DONE 
READ CHKSUM BYTE 

GOOD, SOUND SELL AND RETURN 

.. "ERR", iH£;i 3£LL 



OUTPUT 3ELL AM 



CORE 6502 ft! 
USED BY DEBLG SOFTWARE 



SAVE &5o; 



SET SCREEN MODE 

AND IN IT KBD/SCREEU 
AS I/O DEV 

MUST SET HEX MODE! 

. : -. . . ■. |C N 

HEAD A LINE 

CLEAR MOH HODE, SCAM IDX 
GET ITEM, SON-HEX 
CHAP IN A-PEG 



|M) 



FF7o: 


Ab 1 , 


1035 




LDY 


IS] J 


X-REG-U IF NO HEX i'JPL 


FF7A: 


BE 


1056 CHflSHCH 


DEY 






FP73: 


iU Ed 


1051 




a«i 


HON 


NOT POUND, GC 10 MCN 


FF /D: 


E9 CC FP 


luSfi 




CMP 


CHRTBL, Y 


FIND CKND CBAJ IN ! : i 


FFou: 


DU Pb 


1059 




SNE 


CHRSRCH 




FF62: 


<J BE FF 


lubu 




. 


TCdUB 


. _,.: . LI - BRI SPONDia 


FFo5: 


M M 


1061 




ICY 


YSAV 


SUBROUTINE 


FP*j7j 


4C 7 3 FF 


1062 




Jmp 


NXTITM 




FF6A: 


a: ui 




QIC 


LUX 


4PJ J 




PP3Ci 


uA 


. S4 






A 




FF«D: 


uA 


lub5 




ASL 


A 


GOT HEX DIG, 


PFdE: 




Ld66 




ASL 


A 


SHlF : 


FFoF: 


OA 


L061 




ASL 


ft 




FF?J: 


uA 


lu^o 


JXTBU 


ASL 


A 




■ ■ 




1069 




fiCL 


A2L 




■ 


. 


IU70 




ROL 


. . 




■ 


CA 


lli71 




DEX 




LEAVE (-SF! -- 


FFyo: 


10 Fo 


. 




3 PL 


., 




FF9o: 


A 5 il 


: 


. ,-; ; 3 ■• i 


I. DA 


HOEE 




■ 


. 


. - 




.! 


NXTBS2 


IP HOD': I : 


- : ■ . . 


85 jF 


I u ; 5 




LDA 


A2H.X 


. ; A 2 CO 


FF5E: 


'»S ]□ 


1 1)76 




STA 


A1II.X 


. . . . 


FFAO: 




.... 






A1H.X 




PFA2: 


Ed 




NXTBS2 


I«X 








P*j r: 


1079 




3EC 


NXtBAS 




FFA5: 


DU jo 


. 




■ 


IJXTCKB 




FFA7: 


. 


iuai 


SETNUM 


LDX 


»SuO 


...;. 


FFAVt 


□ (J JL 


10 02 




. 


A2L 




■ 


»6 3F 


IU83 




57 X 


A2H 




FFAD: 


a Li u u j a 


. . . 1 


;xtchi< 


LDA 


IN, Y 


■ 


FFBU: 








1NY 






FFBl: 


49 9u 


. 




EOR 






. 


09 LA 






HI 






. 


jO Cj 


lUoO 




9CC 


DIG 


. , ... 


PPI : 


69 3 


1 i - 




\DC 


r»s ■ 




PPI : 


. • PA 


l u »o 




C.1F 


*SPA 




- 


. 


11.91 




DCS 


DIG 




FF3E: 




Lu92 










FFeE: 


As PE 


Iojj 


ro^L.? 


LDA 




PUSH SlICH-Ol 


PFCus 


4a 






PHA 




SOBS ' . 


FFCii 


... Ej Ff 






LEA 


SUBTBL.Y 


lga ;3der 


- 


48 


■ 




FHA 




. _ : ■■ 


FFC5: 


. 


LOBi 




LDA 


MODE 




PFC 1 : 




I0?a 


ZMDDE 


LDV 




-..-'.... 


Pi - . 


0*1 jl 


....■■ 




. 


MODE 


\-HEG 


FFCB: 


©u 


lluo 




3TS 




co ic stjan . : ■ 


FFCC: 


lC 


llol 


CHRTBL 


DFB 


;3C 


P(»CT«L-C") 


FFCD: 


B2 


11U2 




DF3 


■■i'.; 


F("CTRL-Y") 


FFCE: 


BE 


1103 




DFB 


SBE 


F ("CTRL-E") 


FFCF: 


ED 


: . ,. 




DFB 


SLo 


. '■ 1 " 


! PDU 1 


LF 


1105 




DFB 


5EF 


F<"V"> 


FFD1: 


C4 


lluo 




DFB 


SC4 


F("CTKL-K") 




EC 


11U7 




DFB 


SEC 


F("S") 


FFL_-: 


A3 


1 . - 




DFB 


SA9 


F("CTPL-P"t 


FFC4: 


BE 


11U9 




OFB 


S6B 


:^L-0"t 


FFD5: 


Ac 


1110 




DFB 


5A6 


r ( ■- ■ ] 


FFD6: 


•-: 


: . . . 




DFB 


SA4 


p ( - * » ) 


FFD7: 


■ 


1112 




DFB 


SuC 


",-: IF-EX-OI - - 


FFDe: 


95 


111J 




DFB 


,95 


e i "'. - 1 


FFC*: 


U? 


1114 




DFB 


507 


.- | -:■:" . 


FFDA: 


u2 


1115 




DFB 


502 


PCI") 




U5 


1110 




DFB 


iU5 


Fl-L-J 


FFDCi 


Fu 






DFB 


SFO 


P(-W") 


FFDD: 


UO 


. 




DF9 


SUU 


P(-G") 


FFCE: 


EB 


1119 




DFB 


SEB 


F(-R-) 


FFDF: 


L J j 


1120 




DFE 




F ( " : " ) 




A7 


1121 




DFB 




P ( " ■ - ] 


FFEl: 


ct 


l L22 




DFB 


SCO 


Ff'CRM 


PI . 


99 


1 L2J 




DFB 


599 


FIBLA'^Kl 


ffe:: 


32 


1124 


SUSTBL 


CFB 


•BASCONT - 1 




FPE*: 


C9 


1125 




DFB 


IUSP-1 




FFE5: 


BE 


1126 




DFa 


(REGZ-1 





170 



FFEo: CI 


PPEJ 


35 


FFEo 


bC 


FFE .■ 


C3 


FFEA 


90 


?FEB 


vt 


PPEC 


17 




17 


FFEE 


2a 


FFEF 


IF 


PPFO 


U3 




-■ 


fff; 


5D 


i FF - 


CC 


r E r 1 


65 


FFF5 


FC 


FFFfa 


li 


fffi 


U 


FPPfl 


P5 




». j 




P3 


FFFB 


ui 




iJ 




FF 


FKFE 


oo 


FFFF 


FA 



in) 

H2o 

LIJO 

. . -.1 

Liaa 

1133 

■ • 
1135 

■ 

n n 

113a 

U4» 
I 141 

. ;. 
1 i 13 
i 144 

I 1 4S 

114b 

114*3 

■ . I 
1149 

II 30 
1151 

. . :. 
113J 



DFB 
DPQ 
DFB 
DFB 
CFB 
0F3 
DFB 
DFB 
DFB 
DFB 
DFB 
DFB 
DFB 
DFB 
UFQ 
OFB 
DFB 
DFB 
DF3 
CF3 
CFB 
CFB 
QFB 
DFB 
DFB 

ECU 



iTRACe-1 
lVFV-1 

rSTEl - 

rOUTPHT-1 

srtflASiC-l 
i5£TM0DE-l 
tSETMCDE-l 
?H0VE-1 

i l ;■ - 1 

lSETNQRK-1 

IJV-1 
»LIST-1 

»waiTE-i 

IGO-1 

(HEAL-1 
)SBT!40DE-1 
t$ET:'' - 
aCH.MON-1 
»3IANK-1 

iNmi 

-■;■:. 256 
efcESE? 

ireeet; 25fi 

i : e : 



... . ■ . 
HESE1 VECTOR 
/ECTCfl 



71 



SYMBOL TABLE 
(NUMERICAL ORDER) 



0000 


LOCO 


FC76 


SCRL1 


FB5B 


TABV 


0022 


WNDTOP 


FC9E 


CLEOLZ 


FB78 


VIDWAIT 


0026 


GBASL 


FCAA 


WAIT3 


FB9B 


ESC NOW 


002A 


BAS2L 


FCC9 


HEADR 


FBD9 


BELLI 


002D 


V2 


FCE5 


WRTAPE 


FBF4 


ADVANCE 


002E 


FORMAT 


FCFD 


RDBIT 


FC1A 


UP 


0030 


COLOR 


FU2F 


ESC 


FC2C 


ESC1 


0034 


YSAV 


FD62 


CANCEL 


FC62 


CR 


0038 


KSWL 


0001 


LOCI 


FC8C 


SCRL2 


003C 


AIL 


0023 


WNDBTM 


FCAO 


CLE0L2 


0040 


A3L 


0027 


GBASH 


FCB4 


NXTA4 


0044 


A5L 


002B 


BAS2H 


FCD6 


WRBIT 


0047 


YREG 


002D 


RMNEI1 


FCEC 


RDBYTE 


004F 


RNDH 


002F 


LASTIN 


FDOC 


RDKEY 


03F2 


SOFTEV 


0031 


MODE 


FD35 


RDCHAR 


03FB 


NMI 


0035 


YSAV1 


FD67 


GETLNZ 


COOO 


IOADR 


0039 


KSWH 


0020 


WNDLFT 


C030 


SPKR 


00 3D 


A1H 


0024 


CH 


C053 


MIXSET 


0041 


A3H 


0028 


BASL 


C057 


HIRES 


0045 


A5H 


002C 


H2 


C05B 


CLRAN1 


0048 


STATUS 


002E 


MASK 


C05F 


CLRAN3 


0095 


PICK 


002F 


LENGTH 


CFFF 


CLRROM 


03F4 


PWREDUP 


0032 


1NVFLG 


FBOC 


RTMASK 


03FE 


IRQLOC 


0036 


CSWL 


FB26 


VLINEZ 


COOO 


KBD 


003A 


PCL 


F836 


CLRTOP 


C050 


TXTCLR 


003E 


A2L 


F856 


G3CALC 


C054 


LOWSCR 


0042 


A4L 


F87F 


RTMSKZ 


C058 


SETANO 


0045 


ACC 


F8A5 


ERR 


C05C 


SETAN2 


0049 


SPNT 


F8C9 


MNNDX3 


C060 


TAPEIN 


0200 


IN 


F8F5 


NXTCOL 


EOOO 


BASIC 


03F5 


AMPERV 


F926 


PRADR3 


FBOE 


PL0T1 


0400 


LINE1 


F940 


PRNTYX 


F828 


VLINE 


C010 


KBDSTRB 


F94A 


PRBL2 


F838 


CLRSC2 


C051 


TXTSET 


F956 


PCADJ3 


F864 


SETCOL 


C055 


HISCR 


F9A6 


FMT2 


F8B2 


I NSDS 1 


C059 


CLRANO 


FAOO 


MNEMR 


F8A? 


GETFMT 


C05D 


CLRAN2 


FA62 


RESET 


FBDO 


INST DSP 


C064 


PADDLO 


FAA3 


NOFIX 


F8F9 


PRMN2 


E003 


BASIC2 


FABA 


SLOOP 


F92A 


PRADR4 


FB19 


HLINE 


FAE4 


RDSP1 


F941 


PRNTAX 


F831 


RTS1 


FBU 


XLTBL 


F94C 


PRBL3 


FB3C 


CLRSC3 


FB2E 


RTS2D 


F95C 


PCADJ4 


FB71 


SCRN 


FB4B 


SETWND 


F9B4 


CHAR1 


FBBC 


INSDS2 


FB6F 


SETPWPC 


FA40 


IRQ 


F8BE 


MNNDX1 


FB97 


ESCOLD 


FA6F 


INITAN 


F8D4 


PRNTOP 


FBDO 


BASCLC2 


FAA6 


PWRUP 


F910 


PRADR1 


FBFO 


STORADV 


FAC7 


NXTBYT 


F930 


PRADR5 


FC10 


BS 


FAFD 


PWRCON 


F944 


PRNTX 


FC2B 


RTS4 


FBI 9 


RTBL 


F953 


PCADJ 


FC58 


HOME 


FB2F 


INIT 


F961 


RTS2 



172 



F9BA 


CHAR2 


F914 


PRADR2 


FDFO 


C0UT1 


FA4C 


BREAK 


F93B 


RELADR 


FEOB 


STOR 


FA81 


NEWMON 


F94B 


PRBLNK 


FE20 


LT 


FAA9 


SETPG3 


F954 


PCADJ2 


FE58 


VFYOK 


FAD7 


REGDSP 


F962 


FMT1 


FE78 


A1PCLP 


FB02 


DISKID 


F9C0 


MNEML 


FE86 


SETIFLG 


FBtE 


PREAD 


FA59 


OLDBRK 


FE93 


SETVID 


FB39 


SETTXT 


FA9B 


FIXSEV 


FEA7 


I0PRT1 


FB60 


APPLEII 


FAAB 


SETPLP 


FEB6 


GO 


FB8B 


KBDWAIT 


FADA 


RGDSP1 


FECA 


USR 


FBA3 


ESC NEW 


FB09 


TITLE 


FEEF 


WRBYT2 


FBE4 


BELL2 


FB25 


PREAD2 


FF16 


RD3 


FBFC 


RTS3 


FB40 


SETGR 


FF44 


RESTR1 


FC22 


VTAB 


FB65 


STITLE 


FF6S 


MON 


FC42 


CLREOP 


FB94 


NOWAIT 


FF8A 


DIG 


FC66 


LF 


FBC1 


BASCALC 


FFA7 


GETNUM 


FC95 


SCRL3 


FBEF 


RTS2B 


FFCC 


CHRTBL 


FCAB 


wai r 


FBFD 


VIDOUT 


FD84 


ADD I NP 


FCBA 


NXTA3 


FC24 


VTABZ 


FDA3 


XAM8 


FCDB 


ZERDLY 


FC46 


CLE0P1 


FDC5 


RTS4C 


FCEE 


RDBVT2 


FC70 


SCROLL 


FDE3 


PRHEX 


FD13 


KEVIN 


FC9C 


CLREOL 


FDF6 


COUTZ 


FD3D 


NOTCR 


FCA9 


WAIT2 


FE17 


RTS5 


FD6A 


GETLN 


FCCB 


RTS4B 


FE22 


LT2 


0021 


WNDWDTH 


FCE2 


ONEDLY 


FE5E 


LIST 


0025 


CV 


FCFA 


RD2BIT 


FE7F 


A1PCRTS 


0029 


BASH 


FD21 


KEYIN2 


FE89 


SETKBD 


002C 


LMNEM 


FD5F 


NOTCR 1 


FE95 


OUTPORT 


002E 


CHKSUM 


FD71 


BCKSPC 


FEA9 


I0PRT2 


002F 


SIGN 


FD75 


NXTCHAR 


FEBF 


REGZ 


0033 


PROMPT 


FD92 


PRA1 


FECD 


WR I TE 


0037 


CSWH 


FDB3 


XAM 


FEF6 


CRI10N 


003B 


PCH 


FDD1 


ADD 


FF2D 


PRERR 


003F 


A2H 


FDED 


COUT 


FF4A 


SAVE 


0043 


A4H 


FE04 


BLANK 


FF69 


MONZ 


0046 


XREG 


FE1D 


SETMDZ 


FF90 


NXT3IT 


004E 


RNDL 


FE36 


VFY 


FFAD 


NXTCHR 


03F0 


BRKV 


FE75 


A1PC 


FFE3 


SUBTBL 


03F8 


USRADR 


FE84 


SETNORM 


FD8E 


CROUT 


07F8 


M3LQT 


FE8D 


INPRT 


FDAD 


M0D8CHK 


C020 


TAPEOUT 


FE9B 


IOPRT 


FDC6 


XAMPM 


C052 


MIXCLR 


FEB3 


BASCONT 


FDE5 


PRHEXZ 


C056 


LORES 


FEC4 


STEPZ 


FEOO 


BL1 


C05A 


SETAN1 


FEED 


WRBYTE 


FE1S 


SETMODE 


C05E 


SETAN3 


FFOA 


RD2 


FE2C 


MOVE 


C070 


PTRIG 


FF3F 


RESTORE 


FE63 


LIST2 


FBOO 


PLOT 


FFS9 


OLDRST 


FEBO 


SETINV 


F81C 


HLINE1 


FF7A 


CHRSRCH 


FE8B 


INPORT 


F832 


CLRSCR 


FFA2 


NXTBS2 


FE97 


OUTPRT 


F847 


GBASCALC 


FFC7 


ZMODE 


FEBO 


XBASIC 


F879 


SCRN2 


FD7E 


CAPTST 


FEC2 


TRACE 


F89B 


IEVEN 


FD96 


PRYX2 


FED4 


WR1 


F8C2 


MNNDX2 


FDB6 


DATAOUT 


FEFD 


READ 


F8DB 


PRNTBL 


FDDA 


PRDYTE 


FF3A 


BELL 



73 



FF4C SAV1 

FF73 NXTITM 

FF9B NXTBAS 

FFQE TOSUD 



SYMBOL TABLE 
(ALPHABETICAL ORDER) 



003D 


A1H 


F956 


PCADJ3 


FEA7 


I0PRT1 


FE7F 


A1PCPTS 


0095 


PICK 


FA40 


IRQ 


0040 


A3L 


F910 


PRADR1 


FD1B 


KEYIN 


0044 


A5L 


F930 


PRADR5 


002F 


LAST IN 


FBF4 


ADVANCE 


FDDA 


PRBVTE 


FE5E 


LIST 


002A 


3AS2L 


FDE3 


PRHEX 


0001 


LOCI 


0029 


BASH 


F8DB 


PRNTBL 


FE20 


LT 


FD71 


BCKSPC 


0033 


PROMPT 


F9C0 


MNEML 


FEOO 


BL1 


03F4 


PWREDUP 


F8C9 


MNNDX3 


FC10 


BS 


FF16 


RD3 


FF65 


MON 


F9BA 


CHAR 2 


FD35 


RDCHAR 


03FB 


NMI 


0024 


CH 


FAD7 


REGDSP 


FB94 


NOWAIT 


C059 


CLRANO 


FF3F 


RESTORE 


FF90 


NXT3IT 


FC9C 


CLREOL 


004F 


RNDH 


FFAD 


NXTCHR 


FS3C 


CLRSC3 


F87F 


RTMSKZ 


FF59 


OLDRST 


FDED 


COUT 


F961 


RTS2 


C064 


PADDLO 


FC62 


CR 


003C 


AIL 


F95C 


PCADJ4 


0025 


cv 


003F 


A2H 


FBOE 


PL0T1 


F8A5 


ERR 


0043 


A4H 


F914 


PRADR2 


FB97 


ESC OLD 


0045 


ACC 


F94A 


PRDL2 


F9A6 


FMT2 


03F5 


AMPERV 


FB1E 


PREAD 


0026 


GBASL 


FBC1 


BASCALC 


FDE5 


PRHEX2 


FD6A 


GETLN 


EOOO 


BASIC 


F8D4 


PRNTCP 


FCC9 


HEADR 


FBD9 


BELLI 


FD96 


PRYX2 


FB19 


HLINE 


FE04 


BLANK 


FAA6 


PWRUP 


0200 


IN 


FD62 


CANCEL 


FCFD 


RDBIT 


FBS2 


INSDS1 


002E 


CHKSUM 


FDOC 


RDKEY 


cooo 


IOADR 


FCAO 


CLE0L2 


FEBF 


REGZ 


03FE 


IRQLOC 


C05B 


CLRAN1 


FF44 


RESTR1 


COOO 


KBD 


FC42 


CLREOP 


004E 


RNDL 


0038 


KSWL 


F832 


CLRSCR 


F831 


RTS1 


0400 


LINE1 


FDFO 


C0UT1 


FBFC 


RTS3 


0000 


LOCO 


FEF6 


CRMON 


FE78 


A1PCLP 


FE22 


LT2 


FDB6 


DATA0U7 


003E 


A2L 


C053 


MIXSET 


FC2C 


ESC1 


0042 


A4L 


F8C2 


MNNDX2 


FD2F 


ESC 


FD84 


ADDINP 


FF69 


MONZ 


002E 


FORMAT 


FB60 


APPLE 1 1 


FA81 


NEWMON 


F856 


GBCALC 


FBDO 


BASCLC2 


FD5F 


N0TCR1 


FFA7 


GETNUM 


E003 


BASIC2 


FF98 


NXTBAS 


C057 


HIRES 


FBE4 


BELL2 


FD75 


NXTCHAR 


FC58 


HOME 


FA4C 


BREAK 


FA59 


OLDBRK 


FB2F 


INIT 


FD7E 


CAPTST 


FE97 


OUTPRT 


F88C 


INSDS2 


FF7A 


CHRSRCH 



174 



FC9E 


CLEOLZ 


FF3A 


BELL 


C05C 


SETAN2 


C05D 


CLRAN2 


03F0 


BRKV 


FEB6 


SETIFLG 


CFFF 


CLRROM 


F9B4 


CHAR1 


FE18 


3ETM0DE 


F836 


CLRTOP 


FFCC 


CHRTBL 


FB6F 


SETPWRC 


FDF6 


COUTZ 


FC46 


CLE0P1 


002F 


SIGN 


0037 


CSWH 


C05F 


CLRAN3 


0049 


SPNT 


FFBA 


DIG 


F83B 


CLRSC2 


FEOB 


STOR 


FBA5 


ESCNEW 


0030 


COLOR 


C060 


TAPEIN 


FA9B 


FIXSEV 


FDBE 


CROUT 


FEC2 


TRACE 


FB47 


GBA5CALC 


0036 


CSWL 


FECA 


USR 


F8A9 


GETFMT 


FB02 


DISKID 


FE58 


VFYOK 


FED6 


GO 


FB9B 


ESCNOW 


F82S 


VLINE 


C055 


HISCR 


F962 


FMT1 


FCA8 


WAIT 


F89B 


I EVEN 


0027 


GBASH 


0022 


WNDTOP 


FE8B 


INPORT 


FD67 


GETLNZ 


FEEF 


WRBYT2 


FBDO 


INSTDSP 


002C 


H2 


FDA3 


XAMB 


FEA9 


I0PRT2 


FB1C 


HLINE1 


FBI! 


XLTBL 


C010 


KBDS1RB 


FA6F 


INI TAN 


0034 


YSAV 


FD21 


KEYIN2 


FEBD 


INPRT 


FCBC 


SCRL2 


002F 


LENGTH 


0032 


INVFLG 


FC70 


SCROLL 


FE63 


LJST2 


FE9B 


IOPRT 


C05E 


SETAN3 


C056 


LORES 


FB88 


KBDWAIT 


FE80 


SETINV 


002E 


MASK 


0039 


KSWH 


FE84 


SETNORM 


FAOO 


MNEMR 


FC66 


LF 


FB39 


SETTXT 


FDAD 


MODBCHK 


00 2C 


LMNEM 


FABA 


SLOOP 


FE2C 


MOVE 


C054 


LOWSCR 


0048 


STATUS 


FAA3 


NOFIX 


C052 


MIXCLR 


FBFO 


STORADV 


FCBA 


NXTAl 


FBBE 


MNNDX1 


C020 


TAPEOUT 


FFA2 


NXTBS2 


0031 


MODE 


C050 


TXTCLR 


F8F5 


NXTCOL 


07F8 


MSLOT 


03F8 


USRADR 


FCE2 


ONEDLY 


FD3D 


NOTCR 


FBFD 


VIDOUT 


F954 


PCADJ2 


FCB4 


NXTA4 


FC24 


VTABZ 


003B 


PCH 


FAC7 


NXTBYT 


FCAA 


WAIT3 


FBOO 


PLOT 


FF73 


NXTITM 


0021 


WNDWDTH 


F926 


PR ADR 3 


FE95 


OUTPORT 


FEED 


WRBYTE 


F94C 


PRBL3 


F953 


PCADJ 


FDC6 


XAMPM 


FB25 


PREAD2 


003A 


PCL 


0046 


XREG 


F8F9 


PRMN2 


FD92 


PRA1 


FCDB 


ZERDLY 


F944 


PRNTX 


F92A 


PRADR4 


FF4C 


SAV1 


C070 


PTRIG 


F94B 


PRBLNK 


FC95 


SCRL3 


FCFA 


RD2BIT 


FF2D 


PRERR 


C058 


SETANO 


FCEE 


RDBYT2 


F941 


PRNTAX 


FB64 


SETCOL 


FAE4 


RDSP1 


F940 


PRNTYX 


FE89 


SETKBD 


F938 


RELADR 


FAFD 


PWRCON 


FAA9 


SETPG3 


FADA 


RGDSP1 


FFOA 


RD2 


FE93 


SETVID 


FB19 


RTBL 


FCEC 


RDBYTE 


03F2 


SOFTEV 


FBEF 


RTS2B 


FEFD 


READ 


FEC4 


STEPZ 


FCC8 


RTS4B 


FA62 


RESET 


FFE3 


SUBTBL 


FE75 


A 1 PC- 


002D 


RMNEM 


FB09 


TITLE 


0041 


ASH 


FBOC 


RTMASK 


C051 


TXTSET 


0045 


A5H 


FB2E 


RTS2D 


002D 


V2 


FDD1 


ADD 


FDC5 


RTS4C 


FB7B 


VIDWAIT 


002B 


BAS2H 


FE17 


RTS5 


FC22 


VTAB 


FEB3 


BASCONT 


FC2B 


RTS4 


0023 


WNDBTM 


0028 


BASL 


FC76 
F879 


SCRL1 
SCRN2 


FED4 


WR1 



175 



£= 

FECD WRITE 

FDB3 XAM = 

0047 YREG _ 

FFC7 ZMODE ft*. 

FF4A SAVE 

FS71 SCRN 

C05A SETAN1 fc 

FB40 SETGR 

FE1D SETMDZ 

FAAB SETPLP 

FB4B SETWND 

C030 SPKR St 

FB65 STITLE 

FB5B TABV 

FFBE TOSUB 

FC1A UP 

FE36 VFY 

F826 VLINEZ 

FCA9 WAIT? 

0020 WNDLFT 

FCD6 WRBIT 

FCE5 WRTAPE fc= 

FEBO XBASIC 

0035 YSAV1 £ 

SYMBOL TABLE SIZE w. 

2589 BYTES USED 

2531 BYTES REMAINING — 

SLIST 4A - 



fi= 



85 



fc 



176 



GLOSSARY 



65*12: The manufacturer's name for ihe microprocessor at ihe heart of your Apple. 

Address: As a noun: ihe particular number associated with each memory location. On ihe 
Apple, an address is a number between and 65535 (or S0000 and SFFFF hexadecimal). As a 
verb: to refer to a particular memory location. 

Address Bus: The set of wires, or the signal on those wires, which carry the binary-encoded 
address from the microprocessor to ihe rest of the computer. 

Addressing mode: The Apple's*6502 microprocessor has thirteen distinct ways of referring to 
most locations in memory. These thirteen methods of forming addresses are called addressing 
modes. 

Analog: Analog measurements, as opposed to digital measurements, use an continuously vari- 
able physical quantity (such as length, voltage, or resistance* to represent values. Digital meas- 
urements use precise, limited quantities (such as presence or absence of voltages or magnetic 
fields) to represent values. 

AND: A binary function which is "on" if and only if all of us inputs are "on". 

Apple: 1. The round fleshy fruit of a Rosaceous tree (Pyrus Malus). 2. A brand of personal 
computer. 3) Apple Computer. Inc.. manufacturer of home and personal computers. 

ASCII: An acronym for the American Standard Code for Information Inlerchange (often called 
"USASCH" or misinterpreted as "ASC-1I"). This standard axle assigns a unique value from 
to 127 to each of 128 numbers, letters, special characters, and control characters. 

Assembler: I) One who assembes electronic or mechanical equipment. 2) A program which 
converts the mnemonics and symbols of assembly language into the opcodes and operands of 
machine language. 

Assembly language: A language similar in structure to machine language, but made up of 
mnemonics and symbols. Programs written in assembly language are slightly less dilVicull to write 
and understand than programs in machine language. 

BASIC: Acronym for "Beginner's All-Purpose Symbolic Instruction Code". BASIC is a higher- 
level language, similar in structure to FORTRAN but somewhat easier to learn. Ii was invented 
by Kemney and Kurtz ai Dartmouih College in 1963 and has proved to be the most popular 
language for personal computers. 

Binary: A number system with two digits, "0" and "1". with each digit in a binary number 
representing a power of two. Most digital computers are binary, deep down inside. A binary sig- 
nal is easily expressed by ihe presence or absence of something, such as an electrical potential or 
a magnetic field. 

Binary Function: An operation performed by an electronic circuit which has one or more inputs 
and only one output, All inputs and outputs are binary signals, See A.VQ OR, and Exdusive-OR. 

Bit: A Binary iliglT. The smallest amounl of information which a computer can hold. A single 
bit specifies a single value: "0" or "I". Bits can be grouped to form larger values (see Byre and 
tfybbte). 

Board! See Pruned Circuit Board. 



178 



Bootstrap (**bnol">: To get a system running from a cold-start. The name comes from the 
machine's attempts to "pull ilsef off the ground by tugging on its own bootstraps.'* 

Buffer: A device or area of memory which is used to hold something temporarily. The "picture 
buffer" contains graphic information to be displayed on the video screen; the "input buffer" 
holds a partially formed input line. 

Bug: An error. A hardware but; is a physical or electrical malfunction or design error. A software 
bug is an error in programming, either in the logic of the program or typographical in nature. See 
"feature". 

Bus: A set of wires or traces in a computer which carry a related set of data from one place to 
anoihcr, or the data which is on such a bus. 

Byle: A basic unit of measure of a computer's memory. A byte usualy comprises eight bits. 
Thus, it can have a value from to 255. Each character in the ASCII can be represented in one 
byte. The Apple's memory locations are all one byle. and the Apple's addresses of these loca- 
tions consist of two bytes. 

Call: As a verb; to leave the program or subroutine which is currently executing and to begin 
another, usualy with the intent to return to the original program or subroutine. As a noun: an 
instruction which calls a subroutine. 

Character: Any graphic symbol which has a specific meaning to people. Letters (bolh upper- and 
k^er-case). numbers, and various symbols (such as punctuation marks! are all characters. 



-jM Chip: Sec Integrated C 



(ode: A method of representing something in terms of something else. The ASCII code 
represents characters as binary numbers, the BASIC language represents algorithms in lerms of 
program statements. Code is also used to refer to programs, usually in low-level languages. 

Cold-start: To begin to operate a computer which has just been turned on. 

Color burst: A signal which color television sets recognize and convert to the colored dots you 
see on a color TV screen. Without Ihe color burst signal, all pictures would be black-and-white. 

Computer: Any device which can recieve and store a set of instructions, and then act upon those 
instructions in a predetermined and predictable fashion. The definition implies that both the 
instruction and ihe data upon which the instructions act can be changed. A device whose instruc- 
tions cannot be changed is not a computer. 

Control (CTRL) character: Characters in the ASCII character set which usually have no graphic 
representation, but are used to control various functions. For example, the RETURN control 
ih.irjcier is a signal to Ihe Apple that you have finished typing an input low and you wish Ihe 
computer to act upon it. 

CRT: Acronym for "Cathode-Ray lube", meaning any television screen, or a device containing 
such a screen. 

Cursor: A special symbol which reminds you of a certain position on something. The cursor on 
a slide rule lets you line up numbers; the cursor on ihe Apple's screen reminds you of where you 
are when you are typing. 



179 



Data (datum): Information of any type 

Debug: To find bugs and eliminate them. 

DIP: Acronym for "Dual In-line Package", the most common container for an Integrated Cir- 
cuit. DIPs have two parallel rows of pins, spaced on one-tenth of an inch centers. DIPs usually 
come in 14-, 16-, 1 8-, 20-, 24-, and 40-pin configurations. 

Disassembler: A program which converts the opcodes of machine language to the mnemonics of 
assembly language. The opposite of an assembler. 

Display: As a noun; any sort of output device for a computer, usually ■ fftfep screen As B 
noun: to place information on such a screen. 

Edge connector: A socket which mates with the edge of a printed an mi board in order to 
exchange electrical signals. 

Entry point: The location used by a machine-language subroutine which contains the first exe- 
cutable insiruction in that subroutine: consequently, often the beginning of the subroutine. 

Excusivc-OR: A binary function whose value is "oh*"' only if all of its inputs are "off", or all of 
us inputs are "on"'. 

Execute: To perform the intention of a command or instruction, Also, to run a program or a 
portion of a program. 

Feature: A bug as described by the marketing department. 

Format: As a noun: the physical form in which something appears. As a verb: to specify such a 

form. 

Graphic: Visible as a distinct, recognizable shape or color. 

Graphics: A system to display graphic items or a collection of such items. 

Hardware: The physical parts of a computer. 

Hexadecimal: A number system which uses the ten digits through 9 and the six letters A 
through F to represent values in base 16. Each hexadecimal digit in a hexadecimal number 
represents a power of 16. In this manual, all hexadecimal numbers are preceded by a dollar sign 

High-level Language: A language which is more intelligible to humans than it is to machines. 

High-order: The most important, or item with the highest vaue. of a set of similar items. The 
high-order bit of a byte is that which has the highest place value. 

High part: The high-order byte of a two-byte address. In decimal, the high part of an address is 
the quotient of the address divided by 256. In the 6502. as in many other microprocessors, the 
high part of an address comes last when that address is stored in memory. 

Hz (Herti): Cycles per second. A bicycle wheel which makes two revolutions in one second is 
running at 2Hz. The Apple's microprocessor runs ut 1.023. 000H/ 



1 SO 



I/O: See Inpiii/Ouipui. 

mmt IC: See Integrated Circuit, 

3 Input: As a noun: dala which flows from the ouiside world into the computer. As a verb: to 
obtain data from the outside world 

Input/Output (I/O): The software or hardware which exchanges data with the ouiside word. 

^3 Instruction: The smallest portion of a program that a computer can execute. In 6502 machine 
language, an instruction comprises one, two, or three bytes; in a higher-level language, instruc- 
0^ tions may be many characters long. 

Integrated circuit: A small (less thun the si/.e of a fingernail and about as thin) wafer of a glassy 
S material (usually silicon) into which has been etched an electronic circuit. A single IC can con- 
tain from ten to ten thousand discrete electronic components. lCs are usually housed in DIPs 
mm (sec above), und the lerm IC is sometimes used to refer to both the circuit and its package. 

^_ Interface: An exchange of information between one thing and anolner. or the mechanisms 
S which make such an exchunge possible. 

^ Interpreter: A program, usualy written in machine language, which understands and executes a 
higher-level language. 

*5J Interrupt: A physical etfect which causes the computer lo jump to a special interrupt-handling 
subroutine When the interrupt has been taken care of, the computer resumes execution of the 
J5 interrupted program with no noticeable change. Interrupts are used to signal the computer that a 
^ particular device wants attention. 

™J K: Stands for the greek prefix "Kilo", meaning one thousand. In common eomputer-reaicd 
usage. "K" usually represents the quantity 2 . or 1024 (hexadecimal S400). 

Kilobyte: 1.024 by lev 

^J Language: A computer language is a code which (hopefully!) both a programmer and his com- 
puter understand. The programmer expresses what he wants to do in this code, and the com- 
gj puter understands the code and performs the desired actions 

^ Line: On a video screen, a "line" is a horizontal sequence of graphic symbols extending from 
■■J one edge of the screen to the other. To the Apple, an input tine is a sequence of up to 254 char- 
acters, terminated by the control character RETURN. In most places which do not have personal 
BS computers, a line is something you wail in lo use the computer. 

^ Low-level Language: A language which is more intelligible to machines than it is to humans. 

Low-order: The least important, or item with the leasi vaue, of a sei of items. The low-order bil 
*r. in a byte is the bil with the least place vaue. 

Low part: The low-order byte of a two-byle address. In decimal, Ihe low part of an address is the 
tm remainder of the address divided by 256. also called the "address modulo 256." In the 6502, as 

in many oiher microprocessors, the low pari of an address comes first when thai address is stored 
m* in memory. 

Machine language: The lowest level language which a compulcr understands. Machine 



181 



languages are usually binary in nalure. Instructions in machine languuge are single-byte opcodes 
sometimes followed by various operands. 

Memory address: A memory address is a two-byte value which selects u single memory location 
out of the memory map. Memory addresses in the Apple are stored with their low-order bytes 
first, followed by their high-order bytes. 

Memory locution: The smallest subdivision of the memory map to which the computer can 
refer. Each memory location has associated with it a unique address and a certain value. Memory 
locations on the Apple comprise one byte each. 

Memory Map: This term is used to refer to the set of all memory locations which the micropro- 
cesor can address directly. It is also used to describe a graphic representation of a system^ 
memory. 

Microcomputer: A term used to described a computer which is based upon a microprocessor. 

Microprocessor: An integrated circuit which understands and executes machine language pro- 
grams. 

Mnemonic: An acronym (or any other symbol* used in the place of something more difficut to 
remember. In Assembly Language^ each machine language opcode is given a three letter 
mnemonic (for example, the opcode S6ft is given the mnemonic RTS. meaning "ReTurn from 
Subroutine"). 

Mode: A condition or set of conditions under which a certain set of rules apply. 

Modulo: An arithmetic function with two operands. Modulo lakes the first operand, divides it by 
the second, and returns the remainder of the division. 

Monitor: I ) A closed-circuit television receiver. 2) A program which allows you to use your 
computer at a very low level, often with the values and addresses of individual memory locations. 

Multiplexer: An electronic circuit which has many data inputs, a few selector inputs, and one 
output A multiplexer connects one of its many data inputs to its output. The data input it 
chooses to connect to the output is determined by the selector inputs. 

Mux: See Multiplexer. 

Nybble: Colloquial term for half of a byte, or four bits. 

Opcode: A machine language instruction, numerical toften binary) in nalure. 

OR: A binary function whose value is "on" if at least one of its inputs are "on". 

Output: As a noun, data generated by the computer whose destination is the real world. As a 
verb, the process of generating or transmitting such data. 

Page: 1) A screenful I of information on a video display. 2) A quantity of memory locations, 
addressable with one byte. On the Apple, a "page" of memory contains 256 locations. 

Pascal: A noted French scientist. 

PC board: See Printed Circuit Board. 



182 



Peripheral: Something attached lo ihe compuier which is not pan or ihe computer itself. Most 
peripherals are input and/or output devices. 

Personal Computer: A computer with memory, languages* and peripherals which are well-suited 
for use in a home, office, or school, 

Pinout: A description of the function of each pin on an IC. often presented in the form of a 
diagram. 

Potentiometer: An electronic component whose resistance lo the flow of electrons is propor- 
tional to the setting of a dial or knob. Also known as a "pot" or "variable resistor". 

Printed Circuit Board: A sheet of fiberglass or epoxy onto which a thin layer of metal has been 
applied, then elched away to form traces. Electronic components can then be atlaiched to the 
board with molten solder, and they can exchange electronic signals via the etched traces on the 
board. Small printed circuit boards are often called "cards", especially if they are meant lo con- 
nect wiih edge connector* 

Program: A sequence of instructions which describes a process. 

PROM: Acronym for "Programmable Read-Only Memory". A PROM is a ROM whose contents 
can be altered by electrical means. Information in PROMs does not disappear when the power is 
turned off. Some PROMs can be erased by ultraviolet light and be reprogrammed. 

RAM: See Random-Access Memory. 

Random-Access Memory (RAM): This is the main memory of a computer. The acronym RAM 
can be used lo refer eiihcr to ihe integrated circuits which make up this type of memory or the 
memory itself. The compuier can store values in distinct locations in RAM and recall them 
again, or alter and re-store them if il wishes. On the Apple, as wiih most small computers, the 
values which are in RAM memory are lost when the power to ihe computer is turned off. 

Read-Only Memory (ROM): This lype of memory is usually used to hold important programs 
or data which must be available to the compuier when the power is first turned on. Information 
in ROMs is placed there in the process of manufacturing the ROMs and is unalterable. Informa- 
tion stored in ROMs does not disappear when ihe power is turned off. 

Reference: 1 1 A source of information, such as this manual. 2) As a verb, the aclion of examin- 
ing or altering the contents of a memory location. As a noun, such an aclion. 

Return: To exit a subroutine and go back to the program which called il. 

ROM: See Read-Only Memory. 

Run: To follow Ihe sequence of inslruclions which comprise a program, and to complete the 
process outlined by the inslruclions. 

Scan line: A single sweep of a cathode beam across the face of a cathode-ray tube. 

Schematic: A diagram which represents the electrical interconnections and circuitry of an elec- 
tronic device. 

Scroll: To move all the text on a display (usually upwards) to make room for more (usually at 
the bottom). 



183 



Sof! switch: A two-position switch which can be "thrown" either way by the software of a com- 
puter. 

Software: The programs which give the hardware something to do. 

Slack: A reserved area in memory which can be used to store information temporarily. The 
information in a stack is referenced not by address, but in the order in which it was placed on the 
slack. The lasi datum which was "pushed" onto the stack will be Ihe first one to be "popped" 
off it. 

Strobe: A momentary signal which indicates the occurrence of a specific event. 

Subroutine: A segment of a program which can be executed by a single call. Subroutines are 
used to perform the same sequence of inslruclions at many different places in one program. 

Syntax: The structure of instructions in a given language. If you make a misiake in entering an 
insiruction and garble the syntax, the computer sometimes culls this u "SYNTAX ERROR." 

Text: Characters, usually letters and numbers. "Text" usually refers to large chunks of English. 
rather than computer, language. 

Toggle switch: A two-position switch which can only flip from one position to the other and 
back again, and cannot be directly set either way. 

Trace: An etched conductive path on a Pnnied-Graut Board which serves to demonically con- 
nect eomponeniv 

Video: I ) Anyihing visual. 2) Information presented on the face of a cadwde-ray tube. 

Warm-start: To restart Ihe operation of a computer after you have lost control of its language or 
operating system. 

Window: Something oul of which you jump when ihe power fails and you lose a large program. 
Really; a reserved area on a display which is dedicaied to some special purpose. 



184 



Here are some other publications which you might enjoy: 



Synertek/MOS Technology 6500 Programming Manual !£■ 

This manual is an introduction to machine language programming for the MC6502 microproces- 
sor, h describes the machine lanuage operation of the Apple's microprocessor in meticulous £ 
detail. However, ii contains no specific information about the Apple. 

This book is available from Apple. Order part number A2L0003. St 

Synertek/MOS Technology 650(1 Hardware Manual 

This manual contains a detailed description of the internal operations of the Apple's 6502 „_ 
microprocessor. It also has much information regarding interfacing the microprocessor to exter- *£ 
nal devices, some of which is pertinent to the Apple. 

s 

This book is also available from Apple. Order part number A2L0002. 



The Apple II Monitor Peeled 

This book contains a thorough, well-done descripiion of the operating subroutines within the 
Apple's original Monitor ROM. 

This is available from Ihe author: 

William E. Dougherty 
14349 San Jose Street 
Los Angeles, CA 91345 



Programming Ihe 6502 |7 

This book, written by Rodnay Zaks. is an excellent tutorial manual on machine and assembly- 
lunguage programming for the Apple's 6502 microprocessor. 



This manual is available from Sybex Incorporated. 2020 Milvia, Berkeley. CA 94704. It should 
also be uvailable at your local computer retailer or bookstore. Order book number C202. 



6502 Applications 

This book, also written by Rodnay Zaks. describes many applications of the Apple's 6502 

microprocessor. 

This is also available from Sybcx. Order book number [5302. 



System Description: The Apple II 

Written by Steve Wozniak. the designer of the Apple computers, this article describes the basic 
construction and operation of the Apple II. 

This article was originally published in the May, 1977 issue or BYTE magazine, and is available 
from BYTE Publications. Inc. Peterborough. NH 30458. 



- 



186 



SWEET16: The 6582 Dream Machine 

Also written by Steve Wozniak, this article describes the SWEET16* interpretive machine 
language enclosed in Ihe Apple's Integer BASIC ROMs. 

This article appeared in the October. 1977 issue of BYTE magazine, and is available from BYTE 
Publications, Inc. Peterborough. NH 30458. 



More Colors for your Apple 

This article, written by Allen Watson III. describes in detail the Apple High-Resolution Graphics 
mode. Also included is u reply by Steve \V^niak, the designer of the Apple, describing a 
modification you can make to update your Revision Apple to add the two extra colors available 
on the Revision I board. 

This article appeared in the June, 1979 issue of BYTE magazine, and is available from BYTE 
Publications, Inc. Peterborough. NH 30458. 



Call APPLE (Apple Puuet Sound Program Library Exchange) 

This is one of the largest Apple user group newsletters. For information, write: 

Apple Puget Sound Program Library Exchange 
6708 39th Ave. Southwest 
Scatte, Wash.. 98136 



The Cider Press 

This is another large club newsletter. Eor information, write: 

The Cider Press 

c/o The Apple Core of San Erancisco 

Box 4816 

San Erancisco, CA 94101 



187 



[88 



DEX 



190 GENERAI 

1 94 IT 

; PHOTOS 
rABLES 

195 CAST OF CHARACTERS 



IM'J 



GENERAL INDEX 



boards. Revision 3. 26 

1 board. Revision 3, 26 

2716 type PROMs 94 

50Hz modification, Eurapple 10 

6502 instruction set Appendix A 

6502 internal registers 53, 81 

6502 microprocessor 3, 88 

- A - 

Access Memory (RAM), Random 3 

address and data buses 88, 90 

address multiplexer. RAM 96 



addresses and data 


40 


addressing modes 


66 


analog inputs 


24 


annunciator outputs 

annunciator special locations... 
Apple Firmware card 


23, 36, 100 

24 

73 


Apple Language card 


3 


Apple main board, the 


3,89 

49 


Apple, photo of the.., 


2 


Apple, setting up the 


2.92 

2 







ASCII character code 5. 6, 7, 8, 15 

ASCII codes, keys and 7 

Autostart ROM listing Appendix C 

Autostart ROM Reset 36 

Autostart ROM special locations 37 

Autostart ROM 25 

auxiliary video connector 9 



-- B-- 

backspace character 30 

backspace key 34 

BASIC, entering 34, 54 

BASIC, reentering 34, 54 

bell character 31 

block pinout. configuration 71 

blocks, RAM configuration 70 

board I/O. peripheral 79 

board. Revision 3. 26 

board. Revision I 3, 26 

board, the Apple main 3, 89 

board schematic, main 110 

buffer, picture 12 

buffer, input 33 

built-in I/O 78. 98 






buses, address and data 

byte, power-up 

.. c - 

card. Apple Language 

card. Apple Firmware 

cassette interface jacks 

Cassette interface 

cassette tape, saving to 

cassette tape, reading from 

changing memory 

character code. ASCII 5. 

character, backspace 

character, line-feed 

character. RETURN 

character, bell 

characters, prompting 

characters, keyboard 

characters, control 

clearing the keyboard strobe 

code. ASCII character 5. 

codes, escape 

codes, keys and ASCII 

cold start 

colors, Low-Res 

colors, High-Res 

colors, European High-Res 

command loops. Monitor 

commands, creating your own 

commands, summary of Monitor.. 

comparing memory 

configuration block pinout 

configuration blocks. RAM 

configuration. RAM memory ,. 

connector pinout, peripheral 

connector, keyboard 

connector, power „ 

connector, speaker 

connector. Game I/O 

connector, auxiliary video 

connector, video 

connectors, peripheral 

connnecior pinouts. keyboard 

control characters 

control values. Normal/Inverse 

Controllers, Game 

COUT, KEVIN switches 

COUT standard output subroutine. 

creating your own commands 

CSW/K.SW switches 



...88. 90 
...37,65 



3 



73 

22. 103 

22 

46 

47 

43 

6. 7. 8. 15 

30 

..30 

30 

31 

33 

7,8 

7 

6 

6.7.8, 15 

34 

7 

36 

11. 17 

.11. 19. 26 

20 

56 

57 

59 

46 

71 

70 

70 

",..106 

5. 102 

104 

105 

23. 100 

9 

9 

3. 105 

103 

7 

32 

....24. 100 

83 

30 

57 

83 



190 






.. f „ 



■ 



cursor 30 

cursor, output 30 

cycle, the RESET 36 

-- I) - 

data buses, address and 90 

data, addresses and 40 

debugging programs 51 

displuy special locations, video 13 

display, video 9 

- E- 

editing an input line 33 

cdiling features 25 

entering BASIC 34, 54 

entering the Monitor 40 

entry vector, soft 37 

escape (ESC) codes 34 

Eurapple 50Hz modification 10 

European High-Res colors 20 

examining memory.... 41 

expansion ROM... 84 



feature, the Stop-List 26, 30 

features, input/output 20 

features, editing 25 

features, keyboard 5 

features, microprocessor 88 

features, power supply 92 

Firmware curd. Apple 73 

(''flag") inputs, one-bit 24, 78 

formal. Text screen 16 

format. Low-Res screen 18 

format, High-Res screen 21 

from cassette tape, reading 47 

--G -- 

Game Controllers 24 

Game I/O connector 23. 100 

generator, the video 96 

GETLN and input lines }} 

graphics modes 1 1 

graphics. High-Res 19 

graphics. Low-Res 17 



— -H 



hexadecimal notation 40 

High-Res colors. European 20 



High-Res graphics 19 

High-Res screen, the 21 

High-Res video mode, the 19 

High-Res colors 19. 26 

.. |__ 

input buffer 33 

input line, editing an 33 

input lines, GETLN and 33 

input prompting 32 

input subroutine. RDKEY standard 32 

input/output features 20 

input/output special locations 25 

input/output 78 

inputs, data 78 

inputs, one-bit ("flag") 24. 78 

inputs, analog 24 

inputs, single-bit pushbutton 78 

instruction set, 6502 Appendix A 

instructions. Mini- Assembler 66 

interface jacks, cassette 22. 103 

interface, cassette 22 

internal registers, 6502 53. 81 

interrupts 65, 107. 108 

inverse text mode 32, 54 

I/O connector. Game 23, 100 

I/O programming suggestions 80 

I/O special locations 79 

I/O. built-in 78. 98 

I/O, peripheral board ,79 

I/O, peripheral slot 79 

- .1 - 

jacks, cassette interface 22, 103 

jack?., video output 97 

jumper. "USER 1" 99 

--K- 

key. buckspace 34 

key. retype 34 

keyboard characters 7. 8 

keyboard connector 5. 102 

keyboard connnector pinouts 103 

keyboard features 5 

keyboard schematic 101 

keyboard special locations 6 

keyboard strobe 6. 78, 79. 98. 102 

keyboard strobe, clearing the 6 

keyboard, review of the 4. 100 

keyboard, reading the 6 

KEYIN switches. COUT 83 



191 



3, 69 

50 

33 

30 

33 

Appendix C 
Appendix C 



keys and ASCII codes 7 

-- L-- 

Language card. Apple 

leaving ihe Mini-Assembler... 

line, editing an inpui 

line-feed character 

lines, GETLN and inpui 

listing. Autostart ROM 

listing, Monitor ROM 

listing machine language programs 49 

list of special locations Appendix B 

locations, list of special Appendix B 

locations, annunciator special 24 

locations, video display special 13 

locations, input/output special 25 

locutions, text window special 31 

locations. Autostart ROM special 37 

locations. Monitor special 65 

locations, keyboard special 6 

locations. I/O special 79 

loops. Monitor command 56 

Low-Res colors 17 

Low-Res screen, the 18 

Low-Res video mode, the 17 

lukewarm start 36 

"M-- 



machine language programs, listing.. 

main board, the Apple 

main board schematic 

map. system memory 

maps, zero page memory 

Memory (RAM), Random Access... 

Memory (ROM). Read-Only 

memory configuration, RAM 

memory map, system 

memory maps, zero page 

memory pages 

memory, examining 

memory, changing 

memory, moving 

memory, comparing 

memory. RAM 

memory, ROM 

microprocessor Features 

microprocessor, 6502 

Mini- Assembler instructions 

Mini-Assembler prompt (!) 

Mini-Assembler. Apple 

Mini-Assembler, leaving the 
mode, the text video 









49 

...3, 89 

110 

68 

74 

3 

3 

70 

68 

74 

68 

41 

43 

44 

46 

.68, 95 
.72, 94 

88 

...3.88 

66 

50 

49 

..50 
..14 



mode, the Low-Res video 17 

mode, the High-Res video 19 

mode, inverse text 32 

mode, normal text 32 

modes, addressing 66 

modes, graphics 1 1 

modification, Eurapple 50Hz 10 

Monitor command loops 56 

Monitor commands, summary of 59 

Monitor prompt (•) 40 

Monitor ROM RESET 38 

Monitor ROM listing Appendix C 

Monitor ROM 

Monitor special locations 

Monitor subroutines, some useful. 

Monitor, entering the 

moving memory 

multiplexer. RAM address 

» N » 

normal text mode 

Normal/Inverse control values 

notation, hexadecimal 

number, random. 






.65 
.61 
40 
.44 
.96 



.32 
.32 

.40 
.33 



-O- 



one (system stack), page 

one-bit ("flag") inputs 

output cursor 

output jacks, video 

output subroutine, COLJT standard 

output, utility strobe 

outputs, annunciator 

outputs, strobe 

own commands, creating your 

__p._ 



69 

..24, 25. 78 

30 



page memory maps, /em 

page one (system stack) 

page /.ero 

pages, screen 

pages, memory , 

peripheral board I/O 

peripheral connector pinout 

peripheral connectors 

peripheral slot I/O 

peripheral slot RAM 

peripheral slot ROM 

photo of the Apple 

picture bufler 

pinout. peripheral connector 



...97 
...30 
...25 
...23 
...78 
...57 



..74 
..69 
...69, 74 

12 

68 

79 

106 

....3, 105 

79 

82 

80 

2 

12 

106 



192 



j 



pinout. configuration block 71 

pinoui, ROM 95 

pinoui, RAM 96 

pinouts. keyboard connnector 103 

power connecior 104 

power supply features 92 

power supply schemaiic 93 

power supply, the Apple 2. 28. 92 

power-up byte 37, 65 

programming suggestions. I/O 80 

programs, running machine language 48 

programs, listing machine language 48 

programs, debugging 51 

PROM, peripheral card 80 

PROM, expansion ROM or 84 

PROMs. 2716 type 94 

prompt (•). Monitor 40 

prompt (!), Mini-Assembler 50 

prompting characlers 33 

prompting, input 32 

pushbutton inputs, single-bit 78 

-R-- 



ROM. Autostart 

ROM. Monitor 

ROM. peripheral slot 

ROM or PROM, expansion 



..25 
..25 
.80 
.84 







.70 


RAM memory configuration 




.70 


RAM memory . 


68 


95 


RAM pinout 




.96 


RAM. peripheral slot 




82 


random access memory (RAM) 




...3 


random number 




.33 


RDKEY standard input subroutine 

reading from cassette tape 


.32 

.47 


reading the keyboard 

read-only memory (ROM) 





6 

3 


reentering BASIC 




.34 
.53 


54 


registers, 6502 internal 




81 


relationships. liming signals and 

RESET cycle, the 


91 

36 


RESET. Autostart ROM 


36 


RESET, Monitor ROM 




38 


return character 


30 


retype key 


34 


review ol" the keyboard 


4. 


100 


Revision boards 


3 


26 


Revision 1 board 




.26 


ROM listing. Autostart 

ROM listing. Monitor 


.App 
.App 


n.t 

nd 
.72 


xC 
xC 


ROM memory 


94 


ROM pinout 




.95 


ROM RESET. Autostart 




.36 


ROM RESET. Monitor... 




.38 



ROM special locations. Autostart 37 



running machine language programs ...48 

-. S- 

saving to cassette tape 4b 

schematic, keyboard 101 

schematic, power supply 93 

schematic, main board 110 

screen format ll 

screen format, Text 16 

screen formal. High-Res 21 

screen format. Low-Res 18 

screen pages 12 

screen soft switches 12 

screen, the text 16 

screen. Ihe Low-Res 18 

screen, ihe High-Res 21 

set. 6502 instruction Appendix A 

setting up the Apple 2 

signals and relationships, liming 

single-bit pushbutton inputs 

sloi I/O. peripheral 

slot RAM, peripheral 

slot ROM. peripheral 

soft entry vector 

sofl switches 

soft switches, screen 

speaker connecior 

special locations, list of 

special locations, video display 

special locations, inpul/oulpul 

special locations, text window 

special locations. Autostart ROM 

special locations, Monitor 

special locations, keyboard 

special locations. I/O 

stack), page one (system 

standard input subroutine. RDKEY. 
standard oulpul subroutine, COUT.. 

start, cold 

start, lukewarm 

start, warm 

STEP and TRACE 

Stop-List feature, the 

strobe output, utility 

strobe outputs 

strobe, clearing the keyboard 

subroutine. COUT standard output., 
subroutine, RDKEY standard input. 
subroulines, some useful Monitor.... 



91 

78 

79 

82 

80 

37 

...12.79.98 

12 

105 

Appendix B 

13 

25 

31 

37 

65 

6 

79 

69 

32 

30 

36 

36 

36 

....26,51 
....26, 30 

25 

78 

6 

30 

32 

61 



193 



suggestions, I/O programming 80 

summary of Monitor commands 59 

supply features, power 92 

supply schematic, power 93 

supply, the Apple power 2. 28, 92 

switches, soft 12, 79. 98 

switches, screen soft 12 

switches, toggle 79 

switches. COUT. KFYIN 83 

switches. CSW/KSW 83 

system memory map 68 

(system slack), page one 69 

system liming 90 

.. T-- 

lape. saving to cassette 46 

tape, reading from cassette 47 

text mode, inverse 32 

text mode, normal 32 

text screen, the 11. 16 

text video mode, the M 

text window special locations 31 

text window, the 31 

timing signals and relationships 91 

liming, system 90 

toggle switches 79 

TRACE, STEP and 26. 51 

.. U „ 

"USER 1" jumper 99 

useful Monitor subroutines, some 61 

utility strobe output 25 

.. V- 

values. Normal/Inverse control 32 

varieties of Apples 25 

vector, soft entry 37 

video connector 9 

video connector, auxiliary 9 

video display 9 

video display special locations 13 

video generator, the 96 

video mode, the lexl 14 

video mode, the Low-Res 17 

video mode, the High-Res 19 

video output jacks 97 

- W - 

warm start 36 

window special locations, text 31 



window, the text 31 

.. Y -- 

your own commands, creating 57 

-- Z - 

zero page memory maps 74 

zero, page 69, 74 

INDEX OF FIGURES 



Figure 1. Map of the Text screen 16 

Rgure 2. Map of the Low-Res mode 18 

Figure 3. Map of the High-Res screen 21 

Figure 4. Cursor-moving escape codes 35 

Figure 5. System Memory Map 68 

Figure 6. Memory Configurations 71 

Figure 7. Configuration Block Pinouis 7] 

Figure 8. Expansion ROM Enable circuit. ..85 

Figure 9. SCFXX decoding 85 

Figure 10. The Apple Main Board 89 

Figure 1 1. Timing Signals 91 

Figure 12. Power Supply Schematic 93 

Figure 13. ROM Pinoul 95 

Figure 14. RAM Pinouis 96 

Figure 15. Auxiliary Video Conneelor 98 

Figure 16. Game I/O Connector Pinout...l00 
Figure 17. Keyboard Schematic Drawing .101 

Figure 18. Keyboard connector Pinoul 103 

Figure 19 Power Connector 104 

Figure 20. Speaker Connector 105 

Figure 21. Peripheral Connector Pinout...l06 
Figure 22. Main Board Schematic 110-115 



194 



INDEX OF PHOTOS 



Photo I The Apple II 

Photo 2. The Apple Power Supply .. 

Photo 3. The Apple Keyboard 

Photo 4. The Video Connectors 

Photo 5. Kurapple jumper puds 

Photo 6. The Apple Character Set... 

Photo 7. The Gume I/O Connector 

Pholo8. The USER I Jumper 



CAST OF 
CHARACTERS 



2 

3 

6 

...10 
...11 
.14 
...23 
...99 



INDEX OF TABLES 



Table 1 


Keyboard Special Locations 


....6 


Table 2. 


Keys and their ASCII codes 


....7 


Table 3. 


The ASCII Character Set 


....8 


Table 4. 


Video Display Memory Ranges 


..12 


Table 5. 


Screen Soft Switches 


.13 


Table 6. 


Screen Mode Combinations 


..13 


Table 7. 


ASCII Screen Character Set 


..15 


Table 8, 


Low-Resolution Colors 


..17 


Table 9 


Annunciator Special Locations 


..24 


Table 10 


Input/Output Special Locations... 


.25 


Table 1 1 


Text Window Special Locations... 


.31 


Table 12 


Normal/Inverse Control Values... 


-.32 


Table 13 


Autostart ROM Special Locations 


..37 


Table 14 


Page Three Monitor Locations .... 


.65 


Table 15 


Mini-Assembler Address Formats 


..66 


Table 16 


RAM Organisation and Usage 


.69 


Table 17. 


ROM Organization and Usage ..... 


..72 


Table 18 


Monitor Zero Page Usage 74 


Table 19 


Applesoft II Zero Page Usage 74 


Table 211 


DOS 3.2 Zero Page Usage 


..75 


Table 21 


Integer BASIC Zero Page Usage.. 


..75 


Table 22 


Built-in I/O Locations 


..79 


Table 23. 


Peripheral Card I/O Locations 


.80 


Tuble 24 


Peripheral Card PROM Locations 


..81 


Table 25 


I/O Location Base Addresses 


..82 


Table 26 


I/O Scratchpad RAM Addresses.. 


..83 


Signal D 


ascriptions: 




Table 27 


Timing 


..90 


Table 28 


Auxiliary Video Output 


..97 


Table 29 


Game I/O Connector 


.100 


Table 30 


Keyboard Connector 


.102 


Table 31 


Power Connector 


.104 


Table 32 


Speaker Connector 


.105 


Table 33 


Peripheral Connector 


07IT 



• 


33 


# 

S 


66 

50.66 


& 

• 


65 

33,38,40 


+ 


55 




55 


; (colon) 


43 


. (period) 


41 


< 


45. 46 


> 


33 


■' 


33 



@ 


35 


A 


34 


B 


34 


C 


J5 


D 


35 


E 

F 


35 


G 


48 


1 


25.35,54 


J 


25,35 


K 




1 


« 


M 


25. 35,45 


N 


54,55 






S., 


52 



T 

V 

w 

CTRL B 
CTRLC 
CTRL E. 
CTRL G 
CTRLH 



(bell) 

(H 



CTRL J (linefeed) 

CTRLK 

CTRL P 

CTRLS 

CTRLU < — > 

CTRLX 

CTRL Y 

ESC 

RETURN 

( 

\ 

I 






..52 

4c. 

47 

54 

30, 40, 54 

53 

30 

30. 33. 34 

30 

55 

54 

26. 30 

33.34 

33 

57. 58 

25.34 

30,33.43 

8 

8. 33 

^ 

50 

— o 



195 



196 



K 




qppkz computer inc 

10260 Bandley Drive 
Cupertino, California 95014